Skip to content

Commit

Permalink
Fix typos and update docstring to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysyngsun committed Jul 10, 2024
1 parent 7bcb78e commit bee9599
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,19 @@ def get(
**kwargs, # noqa: ARG002
):
"""
POST endpoint for loggin a user out.
GET endpoint for loggin a user out.
The logout redirect path the user follows is:
- api.example.com/logout (this view)
- keycloak.example.com/realms/REALM/protocol/openid-connect/logout
- api.example.com/app (see main/urls.py)
- app.example.com
"""
user = getattr(request, "user", None)
if user and user.is_authenticated:
super().post(request)
super().get(request)
return redirect(self._keycloak_logout_url(user))
else:
return redirect("/app")

0 comments on commit bee9599

Please sign in to comment.