Backend finished
Co-authored-by: Álvaro <alvaro6gv@users.noreply.github.com>
This commit is contained in:
22
backend/app/core/config.py
Normal file
22
backend/app/core/config.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
load_dotenv()
|
||||
|
||||
class Settings(BaseSettings):
|
||||
DB_URL: str = os.getenv('DB_URL')
|
||||
SECRET_KEY: str = os.getenv('SECRET_KEY')
|
||||
ALGORITHM: str = os.getenv('ALGORITHM', 'HS256')
|
||||
EXPIRATION: int = int(os.getenv('EXPIRATION', 86400))
|
||||
|
||||
TOTP_INTERVAL: int = int(os.getenv('TOTP_INTERVAL', 30))
|
||||
TOTP_DIGITS: int = int(os.getenv('TOTP_DIGITS', 6))
|
||||
TOTP_ALGORITHM: str = os.getenv('TOTP_ALGORITHM', 'SHA1')
|
||||
TOTP_ISSUER: str = os.getenv('TOTP_ISSUER', 'SSII2FA')
|
||||
TOTP_NAME_PREFIX: str = os.getenv('TOTP_NAME_PREFIX', 'user')
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user