Skip to content

Commit 32d18d3

Browse files
author
John Pinto
committed
On registration success the user is redirected to a Registration
Success page to ensure they read the message informing them there might be a delay in receiving the confirmation link.
1 parent cbb6dad commit 32d18d3

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

app/controllers/registrations_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,9 @@ def handle_org(attrs:)
318318
attrs[:org_id] = org.id
319319
attrs
320320
end
321+
322+
# Override the default Devise after_sign_up_path_for method
323+
def after_sign_up_path_for(_resource)
324+
'/registrations/registration_success'
325+
end
321326
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h1><%= _('Registration Success') %></h1>
2+
3+
<p><%= _('A confirmation email has been sent to your email address. It usually arrives within a few minutes but can sometimes take up to 10 minutes. Please wait and check your inbox and spam/junk folders after that time.') %></p>

config/routes.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@
99
passwords: 'passwords',
1010
sessions: 'sessions',
1111
omniauth_callbacks: 'users/omniauth_callbacks',
12-
invitations: 'users/invitations'
12+
invitations: 'users/invitations',
13+
confirmations: 'devise/confirmations'
1314
}) do
1415
get '/users/sign_out', to: 'devise/sessions#destroy'
1516
end
1617

18+
# Then add the custom route in a devise_scope block
19+
devise_scope :user do
20+
get '/registrations/registration_success', to: 'registrations#registration_success'
21+
end
22+
1723
delete '/users/identifiers/:id', to: 'identifiers#destroy', as: 'destroy_user_identifier'
1824

1925
get '/orgs/shibboleth', to: 'orgs#shibboleth_ds', as: 'shibboleth_ds'

0 commit comments

Comments
 (0)