Auth0 Lock for iOS: SignUp screen option for username

Hi everyone,

I’m using Auth0 Lock for iOS within a SwiftUI app. It works well, but I have just tested today the “SignUp” capability from the app and I’m presented with 3 default fields (+custom, I suppose): email, username, password.

I’d like to use the email as username, how can I hide the username field?

I tried $0.usernameStyle = [.Email] and the database has “Requires Username” disabled. Still the 3 fields.

I’m sure it is trivial, but I cannot find the switch. Can anyone please point me in the right direction?

Thanks!

That’s all you need from configuration standpoint according to the docs https://auth0.com/docs/libraries/lock-ios/v2/configuration#usernamestyle

Other things I would check is that if the build you are testing with is current? Maybe rebuild your project and try again? Also can you double check if lock is configured with the right connection?https://github.com/auth0/Lock.swift#adding-a-database-connection

Thanks!

connections.database(name: “Username-Password-Authentication”, requiresUsername: false)

The “false” was missing in my code. Now works beautifully.

1 Like

Perfect to hear that!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.