16 changed files with 67 additions and 55 deletions
@ -0,0 +1,8 @@
|
||||
class User::ConfirmationsController < Devise::ConfirmationsController |
||||
|
||||
protected |
||||
|
||||
def after_confirmation_path_for(resource_name, resource) |
||||
new_user_confirmation_path(resource) |
||||
end |
||||
end |
@ -1,4 +1,4 @@
|
||||
class Auth::SessionsController < Devise::SessionsController |
||||
class User::SessionsController < Devise::SessionsController |
||||
include Helpers::Email |
||||
|
||||
def create |
@ -1,16 +1,32 @@
|
||||
<h2>Resend confirmation instructions</h2> |
||||
<% content_for :title, "Set your password" %> |
||||
|
||||
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> |
||||
<%= render "devise/shared/error_messages", resource: resource %> |
||||
<% content_for :before_content do %> |
||||
<%= govuk_back_link( |
||||
text: 'Back', |
||||
href: :back, |
||||
) %> |
||||
<% end %> |
||||
|
||||
<%= f.govuk_email_field :email, |
||||
label: { text: "Email address" }, |
||||
autocomplete: "email", |
||||
spellcheck: "false", |
||||
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) |
||||
%> |
||||
<%= form_for(@user, as: :user, html: { method: :patch }) do |f| %> |
||||
<div class="govuk-grid-row"> |
||||
<div class="govuk-grid-column-two-thirds"> |
||||
<%= f.govuk_error_summary(presenter: ErrorSummaryFullMessagesPresenter) %> |
||||
|
||||
<%= f.govuk_submit "Resend confirmation instructions" %> |
||||
<% end %> |
||||
<h1 class="govuk-heading-l"> |
||||
<%= content_for(:title) %> |
||||
</h1> |
||||
|
||||
<%= f.govuk_password_field :password, |
||||
label: { text: "New password" }, |
||||
hint: @minimum_password_length ? { text: "Your password must be at least #{@minimum_password_length} characters and hard to guess." } : nil, |
||||
autocomplete: "new-password" |
||||
%> |
||||
|
||||
<%= render "devise/shared/links" %> |
||||
<%= f.govuk_password_field :password_confirmation, |
||||
label: { text: "Confirm new password" } |
||||
%> |
||||
|
||||
<%= f.govuk_submit "Update" %> |
||||
</div> |
||||
</div> |
||||
<% end %> |
||||
|
@ -1,8 +0,0 @@
|
||||
<p>Hello <%= @resource.email %>!</p> |
||||
|
||||
<p>Someone has requested a link to change your password. You can do this through the link below.</p> |
||||
|
||||
<p><%= govuk_link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> |
||||
|
||||
<p>If you didn't request this, please ignore this email.</p> |
||||
<p>Your password won't change until you access the link above and create a new one.</p> |
@ -1,6 +0,0 @@
|
||||
<p>Hello <%= @resource.name %>!</p> |
||||
|
||||
<p>An account has been created for you to submit CORE data on behalf of <%= @resource.organisation.name %>.</p> |
||||
|
||||
<p>Your username is <%= @resource.email %>, use the link below to set your password. |
||||
<p><%= govuk_link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> |
@ -1,5 +0,0 @@
|
||||
<p>Welcome <%= @email %>!</p> |
||||
|
||||
<p>You can confirm your account email through the link below:</p> |
||||
|
||||
<p><%= govuk_link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p> |
@ -1,5 +0,0 @@
|
||||
<% if @resource.last_sign_in_at.nil? %> |
||||
<%= render partial: "password_change_initial" %> |
||||
<% else %> |
||||
<%= render partial: "password_change_forgotten" %> |
||||
<% end %> |
@ -0,0 +1,11 @@
|
||||
class UsersConfirmable < ActiveRecord::Migration[7.0] |
||||
def change |
||||
change_table :users, bulk: true do |t| |
||||
## Confirmable |
||||
t.string :confirmation_token |
||||
t.datetime :confirmed_at |
||||
t.datetime :confirmation_sent_at |
||||
t.string :unconfirmed_email # Only if using reconfirmable |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue