0
0
Fork 0

Fix log out from user menu not working on Safari (#31402)

This commit is contained in:
Renaud Chaput 2024-08-13 19:49:23 +02:00 committed by GitHub
parent 2b1670da48
commit c3e1d86d58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 102 additions and 34 deletions

View file

@ -187,4 +187,15 @@ class Auth::SessionsController < Devise::SessionsController
def second_factor_attempts_key(user)
"2fa_auth_attempts:#{user.id}:#{Time.now.utc.hour}"
end
def respond_to_on_destroy
respond_to do |format|
format.json do
render json: {
redirect_to: after_sign_out_path_for(resource_name),
}, status: 200
end
format.all { super }
end
end
end