add env file support

This commit is contained in:
2025-11-16 14:38:23 +01:00
parent 129e1984a3
commit eeea1b2091
5 changed files with 16 additions and 4 deletions

View File

@@ -1,11 +1,10 @@
from models import User
from passlib.context import CryptContext
from settings import settings
import sqlite3
import jwt
import datetime
JWT_SECRET = "secret"
connection = sqlite3.connect('database.db')
connection.row_factory = sqlite3.Row
cursor = connection.cursor()
@@ -46,4 +45,4 @@ def login(user: User) -> str:
"exp": exp
}
return jwt.encode(payload=payload, key=JWT_SECRET, algorithm="HS256")
return jwt.encode(payload=payload, key=settings.jwt_secret, algorithm=settings.jwt_algorithm)