diff --git a/fastapi_users/fastapi_users.py b/fastapi_users/fastapi_users.py index c6d3ae37..10ca1465 100644 --- a/fastapi_users/fastapi_users.py +++ b/fastapi_users/fastapi_users.py @@ -95,6 +95,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]): state_secret: SecretType, redirect_url: Optional[str] = None, associate_by_email: bool = False, + is_verified_by_default: bool = False, ) -> APIRouter: """ Return an OAuth router for a given OAuth client and authentication backend. @@ -106,6 +107,9 @@ class FastAPIUsers(Generic[models.UP, models.ID]): If not given, the URL to the callback endpoint will be generated. :param associate_by_email: If True, any existing user with the same e-mail address will be associated to this user. Defaults to False. + :param is_verified_by_default: If True, the `is_verified` flag will be + set to `True` on newly created user. Make sure the OAuth Provider you're + using does verify the email address before enabling this flag. """ return get_oauth_router( oauth_client, @@ -114,6 +118,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]): state_secret, redirect_url, associate_by_email, + is_verified_by_default, ) def get_oauth_associate_router(