diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index 8f8a480b8..4c8a4746c 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?(:confirmation_period_expired) + render "devise/confirmations/expired" else respond_with_navigational(resource.errors, status: :unprocessable_entity) { render :new } end diff --git a/app/views/devise/confirmations/expired.html.erb b/app/views/devise/confirmations/expired.html.erb new file mode 100644 index 000000000..c33ec226c --- /dev/null +++ b/app/views/devise/confirmations/expired.html.erb @@ -0,0 +1,11 @@ +<% content_for :title, "Your invitation link has expired" %> + +
Contact your coordinator to request a new one.
+