🔀 refactor(utils.py): change return type annotation of authenticate_user function from Union[User, None] to Optional[User] for clarity and consistency

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-29 10:45:10 -03:00
commit 8c77613f72

View file

@ -269,7 +269,7 @@ def create_refresh_token(refresh_token: str, db: Session = Depends(get_session))
def authenticate_user(
username: str, password: str, db: Session = Depends(get_session)
) -> User | None:
) -> Optional[User]:
user = get_user_by_username(db, username)
if not user: