perf: 优化OIDC用户未激活时,会循环跳转登录页面

This commit is contained in:
jiangweidong
2023-10-09 17:55:44 +08:00
committed by Bryan
parent 3d27986c96
commit 3ac35eec68
5 changed files with 110 additions and 98 deletions

View File

@@ -166,7 +166,7 @@ class OIDCAuthCallbackView(View):
code_verifier = request.session.get('oidc_auth_code_verifier', None)
logger.debug(log_prompt.format('Process authenticate'))
user = auth.authenticate(nonce=nonce, request=request, code_verifier=code_verifier)
if user and user.is_valid:
if user:
logger.debug(log_prompt.format('Login: {}'.format(user)))
auth.login(self.request, user)
# Stores an expiration timestamp in the user's session. This value will be used if