Skip to content

Commit

Permalink
fix password resets (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
duyle-py authored May 13, 2024
1 parent b448446 commit 9439726
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/password_resets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class PasswordResetsController < ApplicationController

layout "auth"

before_action :set_user_by_token, only: :update
before_action :set_user_by_token, only: %i[ edit update ]

def new
end
Expand All @@ -20,6 +20,7 @@ def create
end

def edit
@user = User.new
end

def update
Expand Down
2 changes: 1 addition & 1 deletion app/views/password_resets/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
header_title t(".title")
%>
<%= form_with url: password_reset_path(token: params[:token]), html: {class: "space-y-6"} do |form| %>
<%= form_with model: @user, url: password_reset_path(token: params[:token]), method: :patch, html: {class: "space-y-6"} do |form| %>
<%= auth_messages form %>

<div class="relative border border-gray-100 bg-gray-25 rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
Expand Down

0 comments on commit 9439726

Please sign in to comment.