providers/oauth2: fix token introspection view

This commit is contained in:
Jens Langhammer 2020-09-28 09:04:31 +02:00
parent ad0d339794
commit b6d7847eae
1 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class TokenIntrospectionParams:
except RefreshToken.DoesNotExist: except RefreshToken.DoesNotExist:
LOGGER.debug("Token does not exist", token=raw_token) LOGGER.debug("Token does not exist", token=raw_token)
raise TokenIntrospectionError() raise TokenIntrospectionError()
if self.token.has_expired(): if self.token.is_expired:
LOGGER.debug("Token is not valid", token=raw_token) LOGGER.debug("Token is not valid", token=raw_token)
raise TokenIntrospectionError() raise TokenIntrospectionError()
try: try:
@ -97,9 +97,9 @@ class TokenIntrospectionView(View):
def post(self, request: HttpRequest) -> HttpResponse: def post(self, request: HttpRequest) -> HttpResponse:
"""Introspection handler""" """Introspection handler"""
try:
self.params = TokenIntrospectionParams.from_request(request) self.params = TokenIntrospectionParams.from_request(request)
try:
response_dic = {} response_dic = {}
if self.id_token: if self.id_token:
token_dict = self.id_token.to_dict() token_dict = self.id_token.to_dict()