Browse Source

update copy on password reset page if user is unconfirmed

CLDC-4033-improve-flow-for-unconfirmed-users
Samuel Young 2 months ago
parent
commit
a52898dd48
  1. 3
      app/controllers/auth/passwords_controller.rb
  2. 6
      app/views/devise/passwords/reset_resend_confirmation.html.erb

3
app/controllers/auth/passwords_controller.rb

@ -4,6 +4,7 @@ class Auth::PasswordsController < Devise::PasswordsController
def reset_confirmation def reset_confirmation
self.resource = resource_class.new self.resource = resource_class.new
@email = params["email"] @email = params["email"]
@unconfirmed = params["unconfirmed"] == "true"
if @email.blank? if @email.blank?
resource.errors.add :email, I18n.t("validations.email.blank") resource.errors.add :email, I18n.t("validations.email.blank")
render "devise/passwords/new", status: :unprocessable_entity render "devise/passwords/new", status: :unprocessable_entity
@ -66,7 +67,7 @@ protected
end end
def after_sending_reset_password_instructions_path_for(_resource) def after_sending_reset_password_instructions_path_for(_resource)
account_password_reset_confirmation_path(email: params.dig("user", "email")) account_password_reset_confirmation_path(email: params.dig("user", "email"), unconfirmed: !resource.confirmed?)
end end
def after_resetting_password_path_for(resource) def after_resetting_password_path_for(resource)

6
app/views/devise/passwords/reset_resend_confirmation.html.erb

@ -6,7 +6,11 @@
<%= content_for(:title) %> <%= content_for(:title) %>
</h1> </h1>
<p class="govuk-body">We’ve sent a link to reset your password to <strong><%= @email %></strong>.</p> <% if @unconfirmed %>
<p class="govuk-body">We’ve sent a link to confirm your email address to <strong><%= @email %></strong>. This will complete your registration onto the CORE service.</p>
<% else %>
<p class="govuk-body">We’ve sent a link to reset your password to <strong><%= @email %></strong>.</p>
<% end %>
<p class="govuk-body">You’ll only receive this link if your email address already exists in our system.</p> <p class="govuk-body">You’ll only receive this link if your email address already exists in our system.</p>
<p class="govuk-body">If you don’t receive the email within 5 minutes, check your spam or junk folders. Try again if you still haven’t received the email.</p> <p class="govuk-body">If you don’t receive the email within 5 minutes, check your spam or junk folders. Try again if you still haven’t received the email.</p>
</div> </div>

Loading…
Cancel
Save