16 changed files with 91 additions and 34 deletions
			
			
		@ -0,0 +1,7 @@ | 
				
			|||||||
 | 
					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 | 
					  include Helpers::Email | 
				
			||||||
 | 
					
 | 
				
			||||||
  def create | 
					  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| %> | 
					<% content_for :before_content do %> | 
				
			||||||
  <%= render "devise/shared/error_messages", resource: resource %> | 
					  <%= govuk_back_link( | 
				
			||||||
 | 
					    text: 'Back', | 
				
			||||||
 | 
					    href: :back, | 
				
			||||||
 | 
					  ) %> | 
				
			||||||
 | 
					<% end %> | 
				
			||||||
 | 
					
 | 
				
			||||||
  <%= f.govuk_email_field :email, | 
					<%= form_for(@user, as: :user, html: { method: :patch }) do |f| %> | 
				
			||||||
    label: { text: "Email address" }, | 
					  <div class="govuk-grid-row"> | 
				
			||||||
    autocomplete: "email", | 
					    <div class="govuk-grid-column-two-thirds"> | 
				
			||||||
    spellcheck: "false", | 
					      <%= f.govuk_error_summary(presenter: ErrorSummaryFullMessagesPresenter) %> | 
				
			||||||
    value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) | 
					 | 
				
			||||||
  %> | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <%= f.govuk_submit "Resend confirmation instructions" %> | 
					      <h1 class="govuk-heading-l"> | 
				
			||||||
<% end %> | 
					        <%= 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 %> | 
				
			||||||
 | 
				
			|||||||
@ -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