fix auth lifetime
This commit is contained in:
@@ -9,3 +9,6 @@ class JwtTokenProcessor(Protocol):
|
||||
|
||||
def validate_token(self, token: str) -> UserId | None:
|
||||
raise NotImplementedError
|
||||
|
||||
def refresh_token(self, token: str) -> str:
|
||||
raise NotImplementedError
|
||||
|
@@ -15,16 +15,12 @@ class LoginUser:
|
||||
self.hasher = password_hasher
|
||||
|
||||
async def __call__(self, request: LoginRequest) -> AuthenticationResponse:
|
||||
print("__call__ request", request)
|
||||
user = await self.user_repository.get_user(filter={"email": request.email})
|
||||
print("__call__ user from repo", user)
|
||||
error = UserInvalidCredentialsError("Email or password is incorrect")
|
||||
if user is None:
|
||||
print("user is none in LoginUser __call__")
|
||||
raise error
|
||||
|
||||
if not self.hasher.verify_password(request.password, user.hashed_password):
|
||||
print("wrong pass in LoginUser __call__")
|
||||
raise error
|
||||
|
||||
return AuthenticationResponse(
|
||||
|
Reference in New Issue
Block a user