Skip to content

Customize which user can login #227

@t-io

Description

@t-io

For one of my projects, I want a user first to confirm their email before they can log in. For this, I use the package django-simple-email-confirmation which extends the user with a boolean is_confirmed. To achieve this behavior I have to either do some syncing with the build-in user.is_active or I have to overwrite TokenObtainSerializer.validate().

So what I would like to propose is a setting SIMPLE_JWT['user_login_rule'] = 'path.to.some.file.function' which returns a boolean and is called here in the TokenObtainSerializer.

This would also resolve the issue #137

If desired I could create a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions