mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: Standardize session confirmation prompt (#24212)
Switches to using a dialog to confirm a session (i.e. sudo mode for account changes where we want to be extra sure the current user is who they say they are) to match what we do with passkeys.
This commit is contained in:
@ -1533,12 +1533,6 @@ class UsersController < ApplicationController
|
||||
raise Discourse::NotFound
|
||||
end
|
||||
|
||||
if params[:password].present?
|
||||
if !confirm_secure_session
|
||||
return render json: failed_json.merge(error: I18n.t("login.incorrect_password"))
|
||||
end
|
||||
end
|
||||
|
||||
if secure_session_confirmed?
|
||||
totp_second_factors =
|
||||
current_user
|
||||
@ -1555,7 +1549,7 @@ class UsersController < ApplicationController
|
||||
|
||||
render json: success_json.merge(totps: totp_second_factors, security_keys: security_keys)
|
||||
else
|
||||
render json: success_json.merge(password_required: true)
|
||||
render json: success_json.merge(unconfirmed_session: true)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user