mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-26 15:55:19 +02:00
convert database.py to database module and convert to UUID datatype in postgres
This commit is contained in:
@@ -7,7 +7,8 @@ from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
import database
|
||||
from auth import ACCESS_TOKEN_EXPIRE_MINUTES, create_access_token, Token, router
|
||||
from database import UserInternal
|
||||
from database import user
|
||||
from database.user import User, UserInternal
|
||||
|
||||
|
||||
def verify_password(plain_password, hashed_password):
|
||||
@@ -31,7 +32,7 @@ def authenticate_user(email: str, password: str) -> bool | UserInternal:
|
||||
:param password: password of the user
|
||||
:return: if authentication succeeds, returns the user object with added name and lastname, otherwise or if the user doesn't exist returns False
|
||||
"""
|
||||
user = database.get_user(email=email)
|
||||
user = database.user.get_user(email=email)
|
||||
if not user:
|
||||
return False
|
||||
if not verify_password(password, user.hashed_password):
|
||||
|
||||
Reference in New Issue
Block a user