fix: 修改OAuth2协议的注销地址为非必填项目

pull/9496/head
jiangweidong 2023-02-09 11:20:54 +08:00 committed by Jiangjie.Bai
parent 3c891ec313
commit 7926f7d75e
2 changed files with 3 additions and 3 deletions

View File

@ -86,9 +86,9 @@ class OAuth2EndSessionView(View):
logger.debug(log_prompt.format('Log out the current user: {}'.format(request.user)))
auth.logout(request)
if settings.AUTH_OAUTH2_LOGOUT_COMPLETELY:
next_url = settings.AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT
if settings.AUTH_OAUTH2_LOGOUT_COMPLETELY and next_url:
logger.debug(log_prompt.format('Log out OAUTH2 platform user session synchronously'))
next_url = settings.AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT
return HttpResponseRedirect(next_url)
logger.debug(log_prompt.format('Redirect'))

View File

@ -49,7 +49,7 @@ class OAuth2SettingSerializer(serializers.Serializer):
required=True, max_length=1024, label=_('Provider userinfo endpoint')
)
AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT = serializers.CharField(
required=False, max_length=1024, label=_('Provider end session endpoint')
required=False, allow_blank=True, max_length=1024, label=_('Provider end session endpoint')
)
AUTH_OAUTH2_LOGOUT_COMPLETELY = serializers.BooleanField(required=False, label=_('Logout completely'))
AUTH_OAUTH2_USER_ATTR_MAP = serializers.DictField(