Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Can the UsernameDoesNotContainAtSign username rule be disabled? #370

Closed
tjrobinson opened this issue Jun 10, 2014 · 4 comments
Closed

Can the UsernameDoesNotContainAtSign username rule be disabled? #370

tjrobinson opened this issue Jun 10, 2014 · 4 comments

Comments

@tjrobinson
Copy link
Contributor

I have a requirement (due to existing data) that usernames can be either an email address or a username (e.g. "Administrator").

I can't enable SecuritySettings.EmailIsUsername because the email is not always the username.

When EmailIsUsername is true, there is a validation rule that fails: "Username cannot contain the '@' character."

I can create a custom UsernameValidator but this is run in addition to the built-in rules.

Is there any way I can get more control over the built-in username validation rules?

Thanks.

@brockallen
Copy link
Owner

There have been several people asking for this and I still think this rule is needed. Check the history for those conversations. What you might want to do is use AuthWithUsernameOrEmail on the login page if you want them to be able to enter either. Hope this helps.

@tjrobinson
Copy link
Contributor Author

@brockallen Oops, I did try and find some previous discussions on the topic but will try again. Thanks for the tip. We're currently just using the core packages "BrockAllen.MembershipReboot" and "BrockAllen.MembershipReboot.Ef" but I'll take a look at AuthWithUsernameOrEmail (presumably in the WebHost/OwinHost packages). I think I understand what you're saying but I'm having to fit this on top of legacy data which makes it a bit trickier to "do the right thing".

@tjrobinson
Copy link
Contributor Author

See also: #331 and #339

@tjrobinson
Copy link
Contributor Author

See: #410 for a possible workaround.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants