diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index dc45531da..d1e584b59 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -11,6 +11,8 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController else respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) } end + elsif resource.errors.map(&:type).include?(:invalid) + render "devise/confirmations/invalid" elsif resource.errors.map(&:type).include?(:already_confirmed) redirect_to user_session_path else diff --git a/app/views/devise/confirmations/invalid.html.erb b/app/views/devise/confirmations/invalid.html.erb new file mode 100644 index 000000000..8d3ad96df --- /dev/null +++ b/app/views/devise/confirmations/invalid.html.erb @@ -0,0 +1,12 @@ +<% content_for :title, "Expired link" %> + +
It looks like you have requested a newer join link than this one. Check your emails and follow the most recent link instead.
+ +For security reasons, your join link expired - get another one using the button below (valid for 3 hours).