2020-08-19 08:32:44 +00:00
|
|
|
"""passbook OAuth2 Session Views"""
|
2020-09-17 19:55:01 +00:00
|
|
|
from typing import Any, Dict
|
2020-08-19 08:32:44 +00:00
|
|
|
|
|
|
|
from django.shortcuts import get_object_or_404
|
2020-09-17 19:55:01 +00:00
|
|
|
from django.views.generic.base import TemplateView
|
2020-08-19 08:32:44 +00:00
|
|
|
|
|
|
|
from passbook.core.models import Application
|
|
|
|
|
|
|
|
|
2020-09-17 19:55:01 +00:00
|
|
|
class EndSessionView(TemplateView):
|
2020-08-19 08:32:44 +00:00
|
|
|
"""Allow the client to end the Session"""
|
|
|
|
|
2020-09-17 19:55:01 +00:00
|
|
|
template_name = "providers/oauth2/end_session.html"
|
2020-08-19 08:32:44 +00:00
|
|
|
|
2020-09-17 19:55:01 +00:00
|
|
|
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
|
|
|
|
context = super().get_context_data(**kwargs)
|
|
|
|
|
|
|
|
context["application"] = get_object_or_404(
|
|
|
|
Application, slug=self.kwargs["application_slug"]
|
2020-08-19 08:32:44 +00:00
|
|
|
)
|
|
|
|
|
2020-09-17 19:55:01 +00:00
|
|
|
return context
|