You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Properties won't override while extending from User model. #2125
@peek4y, it's not that the property isn't overridden, it's that any sub class of the User class still performs validation on email regardless. Is there any particular reason you don't want to include email?
It might almost be easier to build your own "user" model rather than extend the existing one. For now, I will throw a feature label on this issue.
@peek4y, go down to the verify email section on this page to see how to turn email verification off. It's a part of the options parameter of your user model in the model-config.json config file.
@peek4y, sorry that was silly of me. That is for verifying not VALIDATING**. The built-in User model actually depends on email for some of its functionality so it doesn't really make sense to be able to remove it.
I mean a workaround would be to insert a dummy email but currently, we do not support extending the user model without an email at all. I have left a feature tag on this issue so that we could potentially disable the email validation, but realistically, this isn't in high demand (not to say that is wouldn't be useful in certain cases).
In your case, you could extend or use the built-in user model and get your user to provide their email upon registration. From there, you do not need to use an email address to login.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.
in case of we made a model like user on our own can we use the access token built in... and if so do we have to persist it to the data source for example mysql like that model we made.... or keep it in the memory..
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.
Activity
richardpringle commentedon Mar 7, 2016
@peek4y, it's not that the property isn't overridden, it's that any sub class of the
User classstill performs validation on email regardless. Is there any particular reason you don't want to include email?It might almost be easier to build your own "user" model rather than extend the existing one. For now, I will throw a feature label on this issue.
Sorry I couldn't be more helpful!
gothammm commentedon Mar 7, 2016
Ok thanks for the explanation.
Well, all i need is mobile number for validation sometimes and I really dont need the email.
richardpringle commentedon Mar 15, 2016
@peek4y, go down to the verify email section on this page to see how to turn email verification off. It's a part of the options parameter of your user model in the
model-config.jsonconfig file.gothammm commentedon Mar 16, 2016
So, this should skip email validation during sign up right?
Sorry, din't get time to try it out.
richardpringle commentedon Mar 16, 2016
Yeah it should. I actually haven't had time to try it out either to be honest... Let me know how it goes
gothammm commentedon Mar 16, 2016
Nope, it doesn't work 😢
"message": "Theuserinstance is not valid. Details:emailcan't be blank (value: undefined);emailis null (value: undefined)."richardpringle commentedon Mar 16, 2016
Definitely a bug then, I'll take a look
gothammm commentedon Mar 16, 2016
👍 Thanks!
richardpringle commentedon Mar 16, 2016
@peek4y, sorry that was silly of me. That is for verifying not VALIDATING**. The built-in User model actually depends on email for some of its functionality so it doesn't really make sense to be able to remove it.
Instead, you can take a look at the User model code and copy some of its functionality for your own model.
https://github.com/strongloop/loopback/blob/master/common/models/user.js
https://github.com/strongloop/loopback/blob/master/common/models/user.json
gothammm commentedon Mar 17, 2016
Hmm, that doesn't sound right to me. I was wondering if there could be a simpler way to solve this.
richardpringle commentedon Mar 17, 2016
I mean a workaround would be to insert a dummy email but currently, we do not support extending the user model without an email at all. I have left a
featuretag on this issue so that we could potentially disable the email validation, but realistically, this isn't in high demand (not to say that is wouldn't be useful in certain cases).In your case, you could extend or use the built-in user model and get your user to provide their email upon registration. From there, you do not need to use an email address to login.
gothammm commentedon Mar 18, 2016
Got it 👍 will go with a workaround. Hoping to see this feature soon 😄
Emiya0306 commentedon Jun 12, 2016
@richardpringle @peek4y I think it is a good feature that can select special fields to do login. Make it more flexible and more powerful! 👍
8 remaining items
stale commentedon Nov 11, 2017
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the
CODEOWNERSfile at the top-level of this repository.Vandivier commentedon Jan 6, 2018
Does stalebot reopen? Is the Loopback 3 team open to a pull request on this issue?
richardpringle commentedon Jan 7, 2018
@kjdelisle ^
@Vandivier, I'm sure the LoopBack team is always open to pull requests!
richardpringle commentedon Jan 7, 2018
FYI, I'm no longer on the LB team... just thought I would make that clear
ali1tokan commentedon Feb 8, 2018
in case of we made a model like user on our own can we use the access token built in... and if so do we have to persist it to the data source for example mysql like that model we made.... or keep it in the memory..
kjdelisle commentedon Feb 8, 2018
Pull requests welcome!
Though, I would say that you'd probably be better off suggesting this as a part of the next major version of loopback: https://github.com/strongloop/loopback-next
We're looking for more community contributors, and since we're still in alpha, there's plenty of room for change!
stale commentedon Apr 9, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
stale commentedon Apr 23, 2018
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the
CODEOWNERSfile at the top-level of this repository.