Skip to content

Commit

Permalink
Resolves #1580: Asset Link 422 Error
Browse files Browse the repository at this point in the history
  • Loading branch information
gkostin1966 committed Feb 26, 2018
1 parent 73925ff commit b4ef04c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,22 @@ def render_unauthorized(_exception)
# * ensuring the user will be logged out if REMOTE_USER is not set
def clear_session_user
return nil_request if request.nil?

search = session[:search].dup if session[:search]
redirect_to_url = stored_location_for(:user)
user_return_to = session[:user_return_to].dup if session[:user_return_to]
flash_notice = flash[:notice]

if valid_user_signed_in?
sign_in_static_cookie
else
sign_out_static_cookie
request.env['warden'].logout
request.env['warden'].logout(:default)
expire_data_after_sign_out!
end

session[:search] = search
store_location_for(:user, redirect_to_url)
session[:user_return_to] = user_return_to
flash[:notice] = flash_notice
end

def valid_user_signed_in?
Expand Down

0 comments on commit b4ef04c

Please sign in to comment.