Browse Source

Rubocop

pull/238/head
baarkerlounger 3 years ago
parent
commit
878a29c456
  1. 3
      app/controllers/user/confirmations_controller.rb
  2. 12
      app/mailers/notify_devise_mailer.rb
  3. 3
      app/views/devise/mailer/password_change.html.erb
  4. 7
      app/views/devise/mailer/unlock_instructions.html.erb
  5. 2
      config/routes.rb

3
app/controllers/user/confirmations_controller.rb

@ -1,8 +1,7 @@
class User::ConfirmationsController < Devise::ConfirmationsController
protected
def after_confirmation_path_for(resource_name, resource)
def after_confirmation_path_for(_resource_name, resource)
new_user_confirmation_path(resource)
end
end

12
app/mailers/notify_devise_mailer.rb

@ -1,5 +1,5 @@
class NotifyDeviseMailer < Devise::Mailer
require 'notifications/client'
require "notifications/client"
def notify_client
@notify_client ||= ::Notifications::Client.new(ENV["GOVUK_NOTIFY_API_KEY"])
@ -13,27 +13,27 @@ class NotifyDeviseMailer < Devise::Mailer
notify_client.send_email(
email_address: email,
template_id: template_id,
personalisation: personalisation
personalisation: personalisation,
)
end
def reset_password_instructions(record, token, opts = {})
def reset_password_instructions(record, token, _opts = {})
template_id = "4593417c-500f-452c-8111-0f9d311aad0e"
personalisation = {
name: record.name,
email: record.email,
link: "https://#{host}/users/password/edit?reset_password_token=#{token}"
link: "https://#{host}/users/password/edit?reset_password_token=#{token}",
}
send_email(record.email, template_id, personalisation)
end
def confirmation_instructions(record, token, opts = {})
def confirmation_instructions(record, token, _opts = {})
template_id = "00cd7163-4213-4596-b4f9-9e72796e0d76"
personalisation = {
name: record.name,
email: record.email,
organisation: record.organisation.name,
link: "https://#{host}/users/confirmation?confirmation_token=#{token}"
link: "https://#{host}/users/confirmation?confirmation_token=#{token}",
}
send_email(record.email, template_id, personalisation)
end

3
app/views/devise/mailer/password_change.html.erb

@ -1,3 +0,0 @@
<p>Hello <%= @resource.email %>!</p>
<p>We're contacting you to notify you that your password has been changed.</p>

7
app/views/devise/mailer/unlock_instructions.html.erb

@ -1,7 +0,0 @@
<p>Hello <%= @resource.email %>!</p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Click the link below to unlock your account:</p>
<p><%= govuk_link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>

2
config/routes.rb

@ -3,7 +3,7 @@ Rails.application.routes.draw do
devise_for :users, controllers: {
passwords: "user/passwords",
sessions: "user/sessions",
confirmations: "user/confirmations"
confirmations: "user/confirmations",
}, path_names: { sign_in: "sign-in", sign_out: "sign-out" }
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html

Loading…
Cancel
Save