mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Redirect to correct path after logout
This commit is contained in:
parent
f34bca591e
commit
0ecbd87004
4 changed files with 13 additions and 7 deletions
|
@ -16,7 +16,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def after_sign_in_path_for(_resource)
|
||||
if session[:user_return_to] && session[:user_return_to] != login_path
|
||||
if session[:user_return_to]
|
||||
return session[:user_return_to].to_s
|
||||
end
|
||||
|
||||
|
@ -27,6 +27,14 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
def after_sign_out_path_for(_resource)
|
||||
if request.path.match('registrar')
|
||||
registrar_login_path
|
||||
elsif request.path.match('admin')
|
||||
admin_login_path
|
||||
end
|
||||
end
|
||||
|
||||
def user_for_paper_trail
|
||||
if defined?(current_user) && current_user.present?
|
||||
# Most of the time it's not loaded in correct time because PaperTrail before filter kicks in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue