Testys commited on
Commit
ce07356
1 Parent(s): e635cfe

Making small changes on the response to be sent

Browse files
Files changed (1) hide show
  1. users/routes.py +6 -1
users/routes.py CHANGED
@@ -113,7 +113,12 @@ async def face_login(file: UploadFile = File(...), db: Session = Depends(get_db)
113
  refresh_token = await create_refresh_token(data=payload)
114
 
115
  os.remove(image_path)
116
- return JSONResponse(content=token.dict(), status_code=status.HTTP_200_OK)
 
 
 
 
 
117
 
118
  os.remove(image_path)
119
  raise HTTPException(status_code=401, detail="Face not recognized")
 
113
  refresh_token = await create_refresh_token(data=payload)
114
 
115
  os.remove(image_path)
116
+ return JSONResponse(content={
117
+ "access_token": access_token,
118
+ "refresh_token": refresh_token,
119
+ "token_type": "bearer",
120
+ "expires_in": access_token_expires.seconds
121
+ }, status_code=status.HTTP_200_OK)
122
 
123
  os.remove(image_path)
124
  raise HTTPException(status_code=401, detail="Face not recognized")