Skip to content

Commit

Permalink
🐛 fix argument issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yezz123 committed Oct 14, 2023
1 parent 0502b14 commit 6ca4214
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions authx/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _additional_fields(self):

@property
def extra_dict(self):
return self.dict(include=self._additional_fields)
return self.model_dump(include=self._additional_fields)

@property
def issued_at(self) -> datetime.datetime:
Expand Down Expand Up @@ -108,13 +108,11 @@ def decode(
cls,
token: str,
key: str,
algorithms: Sequence[AlgorithmType] = None,
algorithms: Sequence[AlgorithmType] = ["HS256"],
audience: Optional[StringOrSequence] = None,
issuer: Optional[str] = None,
verify: bool = True,
) -> "TokenPayload":
if algorithms is None:
algorithms = ["HS256"]
payload = decode_token(
token=token,
key=key,
Expand All @@ -135,16 +133,14 @@ class RequestToken(BaseModel):
def verify(
self,
key: str,
algorithms: Sequence[AlgorithmType] = None,
algorithms: Sequence[AlgorithmType] = ["HS256"],
audience: Optional[StringOrSequence] = None,
issuer: Optional[str] = None,
verify_jwt: bool = True,
verify_type: bool = True,
verify_csrf: bool = True,
verify_fresh: bool = False,
) -> TokenPayload:
if algorithms is None:
algorithms = ["HS256"]
# JWT Base Verification
try:
decoded_token = decode_token(
Expand Down

0 comments on commit 6ca4214

Please sign in to comment.