mirror of https://github.com/jumpserver/jumpserver
fix: 修改OAuth2协议的注销地址为非必填项目
parent
3c891ec313
commit
7926f7d75e
|
@ -86,9 +86,9 @@ class OAuth2EndSessionView(View):
|
||||||
logger.debug(log_prompt.format('Log out the current user: {}'.format(request.user)))
|
logger.debug(log_prompt.format('Log out the current user: {}'.format(request.user)))
|
||||||
auth.logout(request)
|
auth.logout(request)
|
||||||
|
|
||||||
if settings.AUTH_OAUTH2_LOGOUT_COMPLETELY:
|
|
||||||
logger.debug(log_prompt.format('Log out OAUTH2 platform user session synchronously'))
|
|
||||||
next_url = settings.AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT
|
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'))
|
||||||
return HttpResponseRedirect(next_url)
|
return HttpResponseRedirect(next_url)
|
||||||
|
|
||||||
logger.debug(log_prompt.format('Redirect'))
|
logger.debug(log_prompt.format('Redirect'))
|
||||||
|
|
|
@ -49,7 +49,7 @@ class OAuth2SettingSerializer(serializers.Serializer):
|
||||||
required=True, max_length=1024, label=_('Provider userinfo endpoint')
|
required=True, max_length=1024, label=_('Provider userinfo endpoint')
|
||||||
)
|
)
|
||||||
AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT = serializers.CharField(
|
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_LOGOUT_COMPLETELY = serializers.BooleanField(required=False, label=_('Logout completely'))
|
||||||
AUTH_OAUTH2_USER_ATTR_MAP = serializers.DictField(
|
AUTH_OAUTH2_USER_ATTR_MAP = serializers.DictField(
|
||||||
|
|
Loading…
Reference in New Issue