Skip to content

Commit fc60e7d

Browse files
Update src/fastapi_oauth2/middleware.py
Co-authored-by: Artyom Vancyan <44609997+ArtyomVancyan@users.noreply.github.com>
1 parent 6dbfd40 commit fc60e7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fastapi_oauth2/middleware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def authenticate(self, request: Request) -> Optional[Tuple[Auth, User]]:
109109
return Auth(), User()
110110

111111
token_data = Auth.jwt_decode(param)
112-
if token_data["exp"] and token_data["exp"] < int(datetime.now(UTC).timestamp()):
112+
if token_data["exp"] and token_data["exp"] < int(datetime.now(timezone.utc).timestamp()):
113113
raise OAuth2AuthenticationError(401, "Token expired")
114114

115115
user = User(token_data)

0 commit comments

Comments
 (0)