Browse Source
* Fix sending reset email for admins * Reset does not let you bypass 2FA * Trigger SMS on admin password reset * Update flash message for 2FA * Update Admin Login header * Rubocop * 422 * Revert unused viewpull/318/head
baarkerlounger
3 years ago
committed by
GitHub
19 changed files with 334 additions and 78 deletions
@ -0,0 +1,33 @@
|
||||
<% content_for :title, "Reset your password" %> |
||||
|
||||
<% content_for :before_content do %> |
||||
<%= govuk_back_link( |
||||
text: 'Back', |
||||
href: :back, |
||||
) %> |
||||
<% end %> |
||||
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> |
||||
<%= f.hidden_field :reset_password_token %> |
||||
<div class="govuk-grid-row"> |
||||
<div class="govuk-grid-column-two-thirds"> |
||||
<%= f.govuk_error_summary %> |
||||
|
||||
<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" |
||||
%> |
||||
|
||||
<%= f.govuk_password_field :password_confirmation, |
||||
label: { text: "Confirm new password" } |
||||
%> |
||||
|
||||
<%= f.govuk_submit "Update" %> |
||||
</div> |
||||
</div> |
||||
<% end %> |
@ -0,0 +1,13 @@
|
||||
class AddTrackableToAdminUser < ActiveRecord::Migration[7.0] |
||||
def change |
||||
change_table :admin_users, bulk: true do |t| |
||||
t.string :name |
||||
## Trackable |
||||
t.integer :sign_in_count, default: 0, null: false |
||||
t.datetime :current_sign_in_at |
||||
t.datetime :last_sign_in_at |
||||
t.string :current_sign_in_ip |
||||
t.string :last_sign_in_ip |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue