fix auth lifetime
This commit is contained in:
@@ -17,7 +17,7 @@ class JoseJwtTokenProcessor(JwtTokenProcessor):
|
||||
|
||||
def generate_token(self, user_id: UserId) -> str:
|
||||
issued_at = self.date_time_provider.get_current_time()
|
||||
expiration_time = issued_at + timedelta(hours=self.jwt_options.expires_in)
|
||||
expiration_time = issued_at + timedelta(minutes=self.jwt_options.expires_in)
|
||||
|
||||
claims = {
|
||||
"iat": issued_at,
|
||||
@@ -30,8 +30,10 @@ class JoseJwtTokenProcessor(JwtTokenProcessor):
|
||||
def validate_token(self, token: str) -> UserId | None:
|
||||
try:
|
||||
payload = decode(token, self.jwt_options.secret, [self.jwt_options.algorithm])
|
||||
|
||||
return UserId(UUID(payload["sub"]))
|
||||
|
||||
except (JWTError, ValueError, KeyError):
|
||||
return None
|
||||
|
||||
def refresh_token(self, token: str) -> str:
|
||||
return ""
|
||||
|
Reference in New Issue
Block a user