Skip to content
Snippets Groups Projects
Commit 7b7eac4b authored by Nguyen12.Minh@live.uwe.ac.uk's avatar Nguyen12.Minh@live.uwe.ac.uk
Browse files

Minor change

parent 5e901be6
No related branches found
No related tags found
1 merge request!2Minh
from fastapi import APIRouter, Depends, HTTPException
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from fastapi.security import OAuth2PasswordBearer
from backend.models.models import User
from backend.schemas.user import UserCreate , UserLogin
from backend.database import get_session
......@@ -57,17 +57,3 @@ def login(user_data: UserLogin, session: Session = Depends(get_session)):
"access_token": access_token,
"token_type": "bearer",
}
\ No newline at end of file
# @router.post("/login")
# def login(
# form_data: OAuth2PasswordRequestForm = Depends(),
# session: Session = Depends(get_session),
# ):
# user = session.exec(select(User).where(User.email == form_data.username)).first()
# if not user or not verify_password(form_data.password, user.password):
# raise HTTPException(status_code=401, detail="Invalid credentials")
# access_token = create_access_token(data={"sub": str(user.id)})
# return {"access_token": access_token, "token_type": "bearer"}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment