mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FEATURE: Disallow login via omniauth when user has 2FA enabled.
This commit is contained in:
@ -114,6 +114,11 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
end
|
||||
|
||||
def user_found(user)
|
||||
if user.totp_enabled?
|
||||
@auth_result.omniauth_disallow_totp = true
|
||||
return
|
||||
end
|
||||
|
||||
# automatically activate/unstage any account if a provider marked the email valid
|
||||
if @auth_result.email_valid && @auth_result.email == user.email
|
||||
user.update!(staged: false)
|
||||
|
Reference in New Issue
Block a user