Skip to content

Commit 976e518

Browse files
authored
Destroy all sessions on password reset (rails#54524)
1 parent ffc8c47 commit 976e518

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

railties/lib/rails/generators/rails/authentication/templates/app/controllers/passwords_controller.rb.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class PasswordsController < ApplicationController
1919

2020
def update
2121
if @user.update(params.permit(:password, :password_confirmation))
22+
@user.sessions.destroy_all
2223
redirect_to new_session_path, notice: "Password has been reset."
2324
else
2425
redirect_to edit_password_path(params[:token]), alert: "Passwords did not match."

0 commit comments

Comments
 (0)