Update code in endpoints/signup.post.py
This commit is contained in:
parent
7f078ca6b1
commit
770c3e4df6
@ -7,12 +7,12 @@ from helpers.auth_helpers import authenticate_user, create_access_token
|
|||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/login", response_model=UserResponse)
|
@router.post("/signup", status_code=status.HTTP_201_CREATED, response_model=UserResponse)
|
||||||
async def login(
|
async def login(
|
||||||
user_credentials: UserLogin,
|
user_data: UserLogin,
|
||||||
db: Session = Depends(get_db)
|
db: Session = Depends(get_db)
|
||||||
):
|
):
|
||||||
user = authenticate_user(db, user_credentials.email, user_credentials.password)
|
user = authenticate_user(db, user_data.email, user_data.password)
|
||||||
if not user:
|
if not user:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user