fix: fix broken password+email login because of CORS

This commit is contained in:
maxDorninger
2025-05-25 19:19:57 +02:00
parent 018fa24021
commit 1e97ef0c38
2 changed files with 9 additions and 3 deletions

View File

@@ -101,7 +101,8 @@ class RedirectingCookieTransport(CookieTransport):
bearer_transport = BearerTransport(tokenUrl="auth/jwt/login")
cookie_transport = RedirectingCookieTransport(cookie_max_age=LIFETIME)
cookie_transport = CookieTransport(cookie_max_age=LIFETIME)
oauth_cookie_transport = RedirectingCookieTransport(cookie_max_age=LIFETIME)
bearer_auth_backend = AuthenticationBackend(
name="jwt",
@@ -113,6 +114,11 @@ cookie_auth_backend = AuthenticationBackend(
transport=cookie_transport,
get_strategy=get_jwt_strategy,
)
oauth_cookie_auth_backend = AuthenticationBackend(
name="cookie",
transport=oauth_cookie_transport,
get_strategy=get_jwt_strategy,
)
fastapi_users = FastAPIUsers[User, uuid.UUID](get_user_manager, [bearer_auth_backend, cookie_auth_backend])