diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 931c1a7b8..42fce1714 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -95,4 +95,9 @@ class Users::SessionsController < Devise::SessionsController redirect_to link_sent_path(email: instructeur.email) end end + + # agent connect callback + def logout + redirect_to root_path, notice: I18n.t('devise.sessions.signed_out') + end end diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 88f860191..fc8ec6613 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -5,3 +5,4 @@ en: request_new_password: Request new password sessions: signed_in_multiple_profile: "You are connected ! You can switch between your multiple profiles : %{roles}." + signed_out: You are now disconnected. diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml index b65f39c8d..f45a603b4 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise.fr.yml @@ -5,3 +5,4 @@ fr: request_new_password: Demander un nouveau mot de passe sessions: signed_in_multiple_profile: "Vous êtes connecté(e) ! Vous pouvez à tout moment alterner entre vos différents profils : %{roles}." + signed_out: Vous êtes maintenant déconnecté(e). diff --git a/config/routes.rb b/config/routes.rb index 455eb29ae..1ea777bb2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -155,6 +155,7 @@ Rails.application.routes.draw do get 'lien-envoye' => 'users/sessions#link_sent', as: 'link_sent' post '/instructeurs/reset-link-sent' => 'users/sessions#reset_link_sent' get '/users/password/reset-link-sent' => 'users/passwords#reset_link_sent' + get 'logout' => 'users/sessions#logout' end get 'password_complexity' => 'password_complexity#show', as: 'show_password_complexity'