songtianlun
32ec61fe00
- Implement password reset request and form - Add user validation and expiration checks - Create integration tests for password reset process This commit introduces a complete password reset feature, allowing users to reset their passwords securely. It includes necessary validations to ensure the user is valid and the reset token has not expired. Additionally, integration tests have been added to verify the functionality and edge cases, enhancing overall application security and user experience.
22 lines
660 B
Plaintext
22 lines
660 B
Plaintext
<% provide(:title, "Reset password") %>
|
|
<h1>Reset password</h1>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6 col-md-offset-3">
|
|
<%= form_with(model: @user, url: password_reset_path(params[:id]),
|
|
local: true) do |f| %>
|
|
<%= render 'shared/error_messages' %>
|
|
|
|
<%= hidden_field_tag :email, @user.email %>
|
|
|
|
<%= f.label :password %>
|
|
<%= f.password_field :password, class: 'form-control' %>
|
|
|
|
<%= f.label :password_confirmation, "Confirmation" %>
|
|
<%= f.password_field :password_confirmation, class: "form-control" %>
|
|
|
|
<%= f.submit "Update password", class: "btn btn-primary" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|