mirror of
				https://github.com/fastapi-users/fastapi-users.git
				synced 2025-11-01 01:48:46 +08:00 
			
		
		
		
	Improve type hints (#1401)
* Add type parameters to `AuthenticationBackend` * add more type-hints
This commit is contained in:
		| @ -3,7 +3,7 @@ from typing import Optional | ||||
|  | ||||
| from beanie import PydanticObjectId | ||||
| from fastapi import Depends, Request | ||||
| from fastapi_users import BaseUserManager, FastAPIUsers | ||||
| from fastapi_users import BaseUserManager, FastAPIUsers, models | ||||
| from fastapi_users.authentication import ( | ||||
|     AuthenticationBackend, | ||||
|     BearerTransport, | ||||
| @ -47,7 +47,7 @@ async def get_user_manager(user_db: BeanieUserDatabase = Depends(get_user_db)): | ||||
| bearer_transport = BearerTransport(tokenUrl="auth/jwt/login") | ||||
|  | ||||
|  | ||||
| def get_jwt_strategy() -> JWTStrategy: | ||||
| def get_jwt_strategy() -> JWTStrategy[models.UP, models.ID]: | ||||
|     return JWTStrategy(secret=SECRET, lifetime_seconds=3600) | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Zinov
					Alexander Zinov