add env file support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user