diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9069855..e1ca731 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,7 @@ rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized def user_not_authorized - render(file: File.join(Rails.root, 'public/403.html'), status: 403, layout: false) + redirect_to root_url, alert: I18n.t('unauthorized') end before_filter :set_locale diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index a76c7bb..171a7da 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -157,7 +157,7 @@ # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes + config.timeout_in = 1.minutes # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. diff --git a/config/locales/de.yml b/config/locales/de.yml index 6649b1f..c764bf6 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -38,6 +38,7 @@ welcome_links: "

" ccid_message: "" + unauthorized: "Bitte loggen Sie sich ein oder melden Sie sich fortsetzen." admin: org_title: "Name der Organisation" diff --git a/config/locales/en-UK.yml b/config/locales/en-UK.yml index 55158f9..052082c 100644 --- a/config/locales/en-UK.yml +++ b/config/locales/en-UK.yml @@ -41,6 +41,8 @@ screencast_text: "Screencast on how to use %{application_name}" screencast_error_text: "Your browser does not support the video tag." + unauthorized: "You need to sign in or sign up before continuing." + admin: language: "Language" language_name: "Language name" diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml index 91b09d9..915b591 100644 --- a/config/locales/en-US.yml +++ b/config/locales/en-US.yml @@ -41,6 +41,8 @@ screencast_text: "Screencast on how to use %{application_name}" screencast_error_text: "Your browser does not support the video tag." + unauthorized: "You need to sign in or sign up before continuing." + admin: org_title: "Organization name" org: "Organization" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4570d10..31643ce 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -44,6 +44,8 @@ welcome_links: "Le modèle de plan de gestion des données Portage s'appuie sur des normes internationales et sur les meilleures pratiques. Il a été préparé et est gardé à jour par un groupe d'experts en gestion des données de recherche travaillant au sein de bibliothèques de recherche à travers le Canada. " ccid_message: "Veuillez noter que nous travaillons actuellement à un système d'authentification unique. Pour le moment, veuillez créer un nouveau compte dans l'Assistant PGD. Vous pourrez associer votre compte existant à votre identifiant campus dès que la fonction sera disponible." + unauthorized: "S'il vous plaît vous connecter ou vous inscrire pour continuer." + screencast_error_text: "Votre navigateur ne permet pas la balise vidéo." none: "Aucun" admin: