[2.x] Add a check for blocked users and show proper error message.

Created on 1 July 2021, over 3 years ago
Updated 9 November 2023, about 1 year ago

Problem/Motivation

If the user is blocked and we try to login with the module active and with the option login_with_username = FALSE.
The error message that shows up is the following:

The username %name has not been activated or is blocked.

But we're dealing only with email. The message should be:

The email %name has not been activated or is blocked.

Steps to reproduce

Install and enable the module.
Turn the option login_with_username to FALSE.
Create a new user and set the status to blocked.
Try to login and check the error message.

Proposed resolution

Add an extra check as we already load the user by email. If the status is empty (0) then we set the error message.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇷Brazil cassioalmeida

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024