mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not capture OAuth user on 2FA page (#27617)
If the `enforce_second_factor_on_external_auth` setting
is disabled and a user logs in with an OAuth method,
they don't automatically get redirected to /preferences/second-factor
on login. However, they can get there manually, and once there
they cannot leave.
This commit fixes the issue and allows them to leave
and also does some refactors to indicate to the client
what login method is used as a followup to
0e1102b332
This commit is contained in:
@@ -652,7 +652,7 @@ class SessionController < ApplicationController
|
||||
|
||||
def current
|
||||
if current_user.present?
|
||||
render_serialized(current_user, CurrentUserSerializer)
|
||||
render_serialized(current_user, CurrentUserSerializer, { login_method: login_method })
|
||||
else
|
||||
render body: nil, status: 404
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user