fix jwks
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
|
||||
from authlib.oauth2.rfc6749 import (
|
||||
AuthorizationCodeMixin,
|
||||
@@ -8,6 +9,17 @@ from authlib.oauth2.rfc6749 import (
|
||||
from layercake.dateutils import fromisoformat, now
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class User:
|
||||
id: str
|
||||
name: str
|
||||
email: str
|
||||
email_verified: bool = False
|
||||
|
||||
def get_user_id(self):
|
||||
return self.id
|
||||
|
||||
|
||||
class OAuth2AuthorizationCode(AuthorizationCodeMixin):
|
||||
def __init__(
|
||||
self,
|
||||
@@ -75,8 +87,8 @@ class OAuth2Token(TokenMixin):
|
||||
self.access_token = access_token
|
||||
self.refresh_token = refresh_token
|
||||
|
||||
def get_user(self) -> dict:
|
||||
return self.user
|
||||
def get_user(self) -> User:
|
||||
return User(**self.user)
|
||||
|
||||
def check_client(self, client: ClientMixin) -> bool:
|
||||
return self.client_id == client.get_client_id()
|
||||
|
||||
Reference in New Issue
Block a user