python-social-auth/social-core

Ability to allow inactive users

gabrielfgularte opened this issue · 0 comments

Expected behaviour

We should have a setting to allow inactive users to login normally on do_complete method.

Actual behaviour

The do_complete method checks user.is_active regardless the project allows or not inactive users to login.

What are the steps to reproduce this issue?

Input clear steps to reproduce the issue for a maintainer.

  1. create a user
  2. inactivate it
  3. try to login and you'll be redirected to the SOCIAL_AUTH_INACTIVE_USER_URL falling back to LOGIN_ERROR_URL and then to to LOGIN_URL.

Any other comments?

On Django, we have the AllowAllUsersModelBackend that when used instead of ModelBackend allow inactive users to login. So what I'm planning to do is to add a new settings ALLOW_INACTIVE_USERS_LOGIN and then check this setting on the on_complete method before the utils.user_is_active check.