Merge pull request #1248 from unilogicbv/routes_index_otp_force_oauth

routes/index.py: otp_force shouldn't apply to OAuth
This commit is contained in:
Matt Scott 2023-02-17 12:14:15 -05:00 committed by GitHub
commit f1b6bef1ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -581,7 +581,7 @@ def get_azure_groups(uri):
def authenticate_user(user, authenticator, remember=False): def authenticate_user(user, authenticator, remember=False):
login_user(user, remember=remember) login_user(user, remember=remember)
signin_history(user.username, authenticator, True) 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.update_profile(enable_otp=True)
user_id = current_user.id user_id = current_user.id
prepare_welcome_user(user_id) prepare_welcome_user(user_id)