소스 검색

登入後回報使用者資料

zooey 2 년 전
부모
커밋
b305ce3b57
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/api/users.py

+ 1 - 1
app/api/users.py

@@ -57,7 +57,7 @@ async def login(data: OAuth2PasswordRequestForm = Depends()):
     else:
         stored_hashed_password = user.password.encode('utf-8')
         if bcrypt.checkpw(password.encode('utf-8'),stored_hashed_password):
-            return {'access_token': access_token}
+            return {'access_token': access_token,'username':user.username,'email':user.email,'points':user.points}
         else:
             return {"message": "Invalid username or password"}