mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Move sign_in_path into the controller it's used...
This commit is contained in:
parent
8e173ef713
commit
27062ea5c3
2 changed files with 9 additions and 9 deletions
|
|
@ -16,7 +16,7 @@ module Admin
|
|||
end
|
||||
|
||||
def verify_user_admin
|
||||
if (current_user.nil?)
|
||||
if current_user.nil?
|
||||
redirect_to sign_in_path
|
||||
return false
|
||||
end
|
||||
|
|
@ -26,5 +26,13 @@ module Admin
|
|||
raise CanCan::AccessDenied.new('You are not authorized to access this page.')
|
||||
end
|
||||
end
|
||||
|
||||
def sign_in_path
|
||||
if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true'
|
||||
User.ichain_login_url
|
||||
else
|
||||
new_user_session_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue