diff --git a/api/kiwi_vpn_api/config.py b/api/kiwi_vpn_api/config.py index a8a2232..c5fab27 100644 --- a/api/kiwi_vpn_api/config.py +++ b/api/kiwi_vpn_api/config.py @@ -3,7 +3,6 @@ from __future__ import annotations import json from enum import Enum from pathlib import Path -from typing import Optional from fastapi import Depends from jose.constants import ALGORITHMS @@ -37,7 +36,7 @@ class DBConfig(BaseModel): class JWTConfig(BaseModel): - secret: Optional[str] = None + secret: str | None = None hash_algorithm: str = ALGORITHMS.HS256 expiry_minutes: int = 30 diff --git a/api/kiwi_vpn_api/routers/user.py b/api/kiwi_vpn_api/routers/user.py index 9409fa4..eae9636 100644 --- a/api/kiwi_vpn_api/routers/user.py +++ b/api/kiwi_vpn_api/routers/user.py @@ -1,6 +1,5 @@ from __future__ import annotations -from typing import Optional from fastapi import APIRouter, Depends, HTTPException, status from jose import JWTError, jwt @@ -18,7 +17,7 @@ class User(BaseModel): capabilities: list[str] @classmethod - def from_db(cls, username: str) -> Optional[User]: + def from_db(cls, username: str) -> User | None: user = db_User.get_by_name(username) if not user: