Skip to content

Validation error when not using email for signup #820

Closed

Description

@skyserpent

I don't want my users to need email to signup for my app so by simply extending the email property in users, I changed the email requirement to false, however, my app gives me an error saying 'email' can't be blank meaning it's a validatesPresenceOf('email') method that's causing this but it's nowhere to be found in code which is why I am confused as to how to overcome this error. Please assist me on how to rid the presence requirement for email. My user model extends 'User' by the way.

I do not want to use email as a requirement, in fact I'm not even using username/pass as a requirement to signup, I simply want to be able to have the user type in their name and that should sign them up.

Here are more details of my user.json:
...
"properties": {
"username": {
"type": "string",
"required": false
},
"password": {
"type": "string",
"required": false
},
"email": {
"type": "string",
"required": false
},
"name": {
"type": "string",
"required": true
}
},
...

Activity

  1. changed the title [-]I get a validation error when I don't want to use email for signup[/-] [+]Validation error when not using email for signup[/+] on Nov 15, 2014
  2. superkhau commented on Feb 26, 2015

    @superkhau
    Contributor

    Please post questions to https://groups.google.com/forum/#!forum/loopbackjs. See https://github.com/strongloop/loopback/wiki/Reporting-issues#question for more details.

    @bajtos @raymondfeng @ritch PTAL, I want to close, but this could also be a bug. Labeling with Question for now.

  3. bajtos commented on Feb 26, 2015

    @bajtos
    Member

    @superkhau It's ok to close this one, thanks for checking.

    @skyserpent The current implementation of User.login allows clients to login via email+password, that's why the email field is required and must be unique. We would like to refactor the authentication to allow developers to provide their own User model (see "Pluggable authentication providers decoupled from the user model" in Roadmap), but that won't happen in the near future.

  4. bajtos commented on Feb 26, 2015

    @bajtos
    Member

    Let's move the discussion to #1137.

  5. locked and limited conversation to collaborators on Feb 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions