backend: configureable Token-Expire

This commit is contained in:
Frank Agerholm 2026-01-25 19:05:47 +01:00
commit c24a5ce480
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View file

@ -13,7 +13,7 @@ from .config import settings
SECRET_KEY = settings.secret_key
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 60
ACCESS_TOKEN_EXPIRE_MINUTES = settings.access_token_expire_minuted
pwd_context = CryptContext(schemes=["bcrypt_sha256"], deprecated="auto")
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/auth/token")

View file

@ -14,6 +14,8 @@ class Settings(BaseModel):
secret_key: str = os.getenv("SECRET_KEY", "CHANGE_ME")
access_token_expire_minuted: int = int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", "60"))
@property
def database_url(self):
return (