loopbackjs - Customizing User built-in Model validation -
I am exploring a way to optimize verification for the underlying user model.
The purpose is to allow users to register an account with a different user name on the same email.
I have tried to override the setup method for the user model to prevent the recognition of specificity. Email property, but unfortunately it was not one. As a hook, I did not find anyone to meet my needs.
For reference, 'loopback / common / model / user. JS: 556: This verification occurs:
if (! (UserModel.settings.realmRequired || UserModel.settings.realmDelimiter)) {UserModel.validatesUniquenessOf ('email', {Message: 'Email already exists'}); UserModel.validatesUniquenessOf ('username', {message: 'user already exists'}); }
Is there any way I can use to disable this email verification?
Thanks in advance.
Disclaimer: I am a loopback team member.
At the moment, it is not possible to allow unique user email One of the reasons is that User.login
is both email
and Username
, that is, you can login by entering an email and password.
In principle, for the sake of your use, loopback can be changed, please open a GitHub problem to discuss possible implementation.
Comments
Post a Comment