Skip to content

Commit 47ad85f

Browse files
committed
override devise for pw reset
1 parent ba2baa8 commit 47ad85f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

app/controllers/users/passwords_controller.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ def create
1818
notice: "If the account exists you will receive an email or SMS with instructions on how to reset your password in a few minutes."
1919
end
2020

21+
22+
def update
23+
self.resource = resource_class.reset_password_by_token(resource_params)
24+
25+
yield resource if block_given?
26+
27+
if resource.errors.empty?
28+
flash[:notice] = "Your password has been changed successfully."
29+
redirect_to new_session_path(resource_name)
30+
else
31+
respond_with resource
32+
end
33+
end
34+
2135
private
2236

2337
def render_error

0 commit comments

Comments
 (0)