From 41a39958656fb49b17e61db721917c1a7cf2eee6 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Tue, 6 Sep 2022 16:28:45 +0200 Subject: [PATCH] routes/index.py: otp_force shouldn't apply to OAuth as 2FA policies are typically enforced on the OAuth proviers end Relates to #1051 --- powerdnsadmin/routes/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index 3a6f55c..3cb365d 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -580,7 +580,7 @@ def get_azure_groups(uri): def authenticate_user(user, authenticator, remember=False): login_user(user, remember=remember) signin_history(user.username, authenticator, True) - if Setting().get('otp_force') and Setting().get('otp_field_enabled') and not user.otp_secret: + if Setting().get('otp_force') and Setting().get('otp_field_enabled') and not user.otp_secret and session['authentication_type'] not in ['OAuth']: user.update_profile(enable_otp=True) user_id = current_user.id prepare_welcome_user(user_id)