Skip to content

Commit 3df174d

Browse files
authored
Update README.md
1 parent 7a5c495 commit 3df174d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ class AuthService:
4949
def __init__(self, jwt_service: JWTService) -> None:
5050
self.jwt_service = jwt_service
5151

52+
async def sign_in(self, username: str, password: str) -> t.Dict:
53+
user = await self.user_service.find_one(username)
54+
if user.password != credentials.password:
55+
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN)
56+
57+
return {
58+
'access_token': await self.jwt_service.sign_async(user.dict())
59+
}
5260
```
5361

5462
## JWTModule Setup

0 commit comments

Comments
 (0)