diff --git a/apps/authentication/backends/oauth2/views.py b/apps/authentication/backends/oauth2/views.py index ad95e29cd..e3b919fff 100644 --- a/apps/authentication/backends/oauth2/views.py +++ b/apps/authentication/backends/oauth2/views.py @@ -86,10 +86,10 @@ class OAuth2EndSessionView(View): logger.debug(log_prompt.format('Log out the current user: {}'.format(request.user))) auth.logout(request) - next_url = settings.AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT - if settings.AUTH_OAUTH2_LOGOUT_COMPLETELY and next_url: + logout_url = settings.AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT + if settings.AUTH_OAUTH2_LOGOUT_COMPLETELY and logout_url: logger.debug(log_prompt.format('Log out OAUTH2 platform user session synchronously')) - return HttpResponseRedirect(next_url) + return HttpResponseRedirect(logout_url) logger.debug(log_prompt.format('Redirect')) return HttpResponseRedirect(logout_url)