Skip to content

Is there support for restricting registration to an allowed lists of emails? #1297

Answered by hgalytoby
shiehn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there, I'm involved in developing an application which will have a private alpha phase. I would like to restrict registration to a specified list of email addresses. Does fastapi-users support this out of the box? If not, how might I extend it to do so? thanks!

You can either override the create method(https://github.com/fastapi-users/fastapi-users/blob/master/fastapi_users/manager.py#L110) from UserManager (https://github.com/fastapi-users/fastapi-users/blob/master/examples/sqlalchemy/app/users.py#L18):

async def create(
        self,
        user_create: schemas.UC,
        safe: bool = False,
        request: Optional[Request] = None,
) -> models.UP:
    """
    Create a user in t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shiehn
Comment options

Answer selected by shiehn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants