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
0e1102b3326ace878c357301e108154051d37c31
This commit is contained in:
Martin Brennan
2024-06-27 10:27:49 +10:00
committed by GitHub
parent 89df5761ff
commit cada172981
6 changed files with 84 additions and 9 deletions

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
module Auth
LOGIN_METHOD_OAUTH = "oauth"
LOGIN_METHOD_LOCAL = "local"
end
require "auth/auth_provider"