From 0f5bb2a861a004b275423e8864fae598968e428f Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Mon, 8 Apr 2024 04:12:46 -0700 Subject: [PATCH] Oops, stay signed in when changing password --- app/controllers/auth_users_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/auth_users_controller.rb b/app/controllers/auth_users_controller.rb index befa40d3..77f9f6d3 100644 --- a/app/controllers/auth_users_controller.rb +++ b/app/controllers/auth_users_controller.rb @@ -25,6 +25,10 @@ class AuthUsersController < ApplicationController @auth_user = load_auth_user if @auth_user.update_with_password(auth_user_params) + # NOTE: Changing the password will sign you out, so make sure we stay + # signed in! + bypass_sign_in @auth_user, scope: :auth_user + flash[:notice] = "Settings successfully saved." redirect_to action: :edit else