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

Commit 86e15d8

Browse files
authored
Merge pull request #82 from nsklikas/fix-token-type
Fix bug from token semantics refactor
2 parents e4d59ab + 9e40a7b commit 86e15d8

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/oidcop/oauth2/token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _mint_token(
5858
) -> SessionToken:
5959
_context = self.endpoint.server_get("endpoint_context")
6060
_mngr = _context.session_manager
61-
usage_rules = grant.usage_rules.get(type)
61+
usage_rules = grant.usage_rules.get(token_class)
6262
if usage_rules:
6363
_exp_in = usage_rules.get("expires_in")
6464
else:

tests/test_24_oauth2_token_endpoint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ def test_do_refresh_access_token(self):
329329
assert set(_resp["response_args"].keys()) == {
330330
"access_token",
331331
"token_type",
332+
"expires_in",
332333
"refresh_token",
333334
"scope",
334335
}
@@ -375,6 +376,7 @@ def test_do_2nd_refresh_access_token(self):
375376
assert set(_2nd_resp["response_args"].keys()) == {
376377
"access_token",
377378
"token_type",
379+
"expires_in",
378380
"refresh_token",
379381
"scope",
380382
}

tests/test_35_oidc_token_endpoint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ def test_do_refresh_access_token(self):
365365
assert set(_resp["response_args"].keys()) == {
366366
"access_token",
367367
"token_type",
368+
"expires_in",
368369
"refresh_token",
369370
"id_token",
370371
"scope",
@@ -412,6 +413,7 @@ def test_do_2nd_refresh_access_token(self):
412413
assert set(_2nd_resp["response_args"].keys()) == {
413414
"access_token",
414415
"token_type",
416+
"expires_in",
415417
"refresh_token",
416418
"id_token",
417419
"scope",

0 commit comments

Comments
 (0)