Removing username field from signup form

Hello.

We are looking for a way to turn off the “Username” field on the sign up form despite the fact that we have “Requires Username” activated on our custom database connection.

Basically we want the email address the user enters to become their username. That is, the same value gets sent to our custom “GetUser” script for both user.email and user.username. We attempted setting usernameStyle to ‘email’ but this does not hide the username field on the signup form.

Is there a way to turn off the username field in the signup form without resorting to JS tricks or having the user type the same value for username and email? We need “Requires Username” activated as we have old legacy accounts that do not use email address for username.

Thanks.

Hi @chris.schwartz,

Welcome to the Community! I’m not sure if you can hide the username field but it is worth noting you cannot use an email address as the username for a database user. This is a bit weird because it is possible to create such a user under some circumstances (user migrated from another source) but a net new database user cannot be created with a username formatted as an email address.

Thank you for the reply.

Actually you can submit an email address for the username field in your ‘Signup’ form in the universal login page. For example, in this example, we’re setting email and username to johnsmith@example.com and the form will submit without any validation error:

We just want a way to hide/remove the second text input so the user doesn’t have to type the same text twice.