Add flag to enable/disable email association with OAuth

This commit is contained in:
François Voron
2022-06-20 13:46:47 +02:00
parent 7862830c0f
commit 64d3996415
4 changed files with 38 additions and 5 deletions

View File

@ -32,6 +32,7 @@ def get_oauth_router(
get_user_manager: UserManagerDependency[models.UP, models.ID],
state_secret: SecretType,
redirect_url: str = None,
associate_by_email: bool = False,
) -> APIRouter:
"""Generate a router with the OAuth routes."""
router = APIRouter()
@ -122,6 +123,7 @@ def get_oauth_router(
token.get("expires_at"),
token.get("refresh_token"),
request,
associate_by_email=associate_by_email,
)
if not user.is_active: