Coverage for src / auth / auth.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-10 22:03 +0200

1from fastapi_users.authentication import CookieTransport, AuthenticationBackend 

2from fastapi_users.authentication import JWTStrategy 

3from src.config import SECRET 

4 

5cookie_transport = CookieTransport(cookie_name="shortist", cookie_max_age=3600) 

6 

7 

8def get_jwt_strategy() -> JWTStrategy: 

9 return JWTStrategy(secret=SECRET, lifetime_seconds=3600) 

10 

11 

12auth_backend = AuthenticationBackend( 

13 name="jwt", 

14 transport=cookie_transport, 

15 get_strategy=get_jwt_strategy 

16)