Simplify generated usernames and insure uniqueness

Created on 21 August 2016, about 9 years ago
Updated 23 July 2025, 2 months ago

Hi. I faced with a problem with this module: initial username is not unique.

Steps to reproduce:
1. Don't implement hook_email_registration_name in your project's custom modules.
2. Register a lot of users (since you didn't implement hook from step 1 you will get a lot users in users table with name like email_registration_[pass]).
3. Once upon the time you can get error

The name %name is already taken.

from user module. It because [pass] can be not so unique as it looks like (user_password() function can generate same passwords).

Suggestion:
Don't rely on user_password() function for generation temporary username.

Here is a patch. I hope it will help.

P.S. I've also fixed some typos in README.txt.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
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