rename user.py to users.py and clean up code

This commit is contained in:
maxDorninger
2025-02-23 11:38:56 +01:00
parent aca686d1e0
commit 606d233ec4
6 changed files with 12 additions and 12 deletions

View File

@@ -7,8 +7,8 @@ from fastapi.security import OAuth2PasswordRequestForm
import database
from auth import ACCESS_TOKEN_EXPIRE_MINUTES, create_access_token, Token, router
from database import user
from database.user import User, UserInternal
from database import users
from database.users import UserInternal
def verify_password(plain_password, hashed_password):
@@ -32,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.user.get_user(email=email)
user = database.users.get_user(email=email)
if not user:
return False
if not verify_password(password, user.hashed_password):