fix token
This commit is contained in:
@@ -15,7 +15,7 @@ class User:
|
|||||||
name: str
|
name: str
|
||||||
email: str
|
email: str
|
||||||
email_verified: bool = False
|
email_verified: bool = False
|
||||||
scope: list[str] | None = None
|
scope: str | None = None
|
||||||
|
|
||||||
def get_user_id(self):
|
def get_user_id(self):
|
||||||
return self.id
|
return self.id
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class OpenIDCode(OpenIDCode_):
|
|||||||
).filter(scope)
|
).filter(scope)
|
||||||
|
|
||||||
if user.scope:
|
if user.scope:
|
||||||
user_info['scope'] = ' '.join(user.scope)
|
user_info['scope'] = user.scope
|
||||||
|
|
||||||
return user_info
|
return user_info
|
||||||
|
|
||||||
@@ -175,10 +175,17 @@ class AuthorizationCodeGrant(grants.AuthorizationCodeGrant):
|
|||||||
user = dyn.collection.get_items(
|
user = dyn.collection.get_items(
|
||||||
TransactKey(authorization_code.user_id)
|
TransactKey(authorization_code.user_id)
|
||||||
+ SortKey('0')
|
+ SortKey('0')
|
||||||
+ SortKey('SCOPE', path_spec='scope', rename_key='scope'),
|
+ SortKey(
|
||||||
|
sk='SCOPE',
|
||||||
|
path_spec='scope',
|
||||||
|
rename_key='scope',
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return User(**pick(('id', 'name', 'email', 'email_verified', 'scope'), user))
|
return User(
|
||||||
|
**pick(('id', 'name', 'email', 'email_verified'), user),
|
||||||
|
scope=' '.join(user['scope']) if 'scope' in user else None,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TokenExchangeGrant(grants.BaseGrant):
|
class TokenExchangeGrant(grants.BaseGrant):
|
||||||
|
|||||||
Reference in New Issue
Block a user