SessionController: if a admin is login in, redirect to admin page
This commit is contained in:
parent
0d8d2de5a6
commit
87967568b7
1 changed files with 5 additions and 1 deletions
|
@ -92,7 +92,11 @@ class Users::SessionsController < Sessions::SessionsController
|
|||
administrateur = Administrateur.find_by(email: gestionnaire.email)
|
||||
[user, gestionnaire, administrateur].compact.each { |resource| sign_in(resource) }
|
||||
|
||||
redirect_to gestionnaire_procedures_path
|
||||
if administrateur.present?
|
||||
redirect_to admin_procedures_path
|
||||
else
|
||||
redirect_to gestionnaire_procedures_path
|
||||
end
|
||||
else
|
||||
flash[:alert] = 'Votre lien est invalide ou expiré, veuillez-vous reconnecter.'
|
||||
redirect_to new_user_session_path
|
||||
|
|
Loading…
Reference in a new issue