Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit d627553

Browse files
committed
Check if token exists
1 parent 8629ccf commit d627553

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/oidcop/oidc/userinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def process_request(self, request=None, **kwargs):
117117
_grant = _session_info["grant"]
118118
token = _grant.get_token(request["access_token"])
119119
# should be an access token
120-
if token.token_class != "access_token":
120+
if token and token.token_class != "access_token":
121121
return self.error_cls(error="invalid_token", error_description="Wrong type of token")
122122

123123
# And it should be valid

0 commit comments

Comments
 (0)