trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
266 stars 141 forks source link

User.register creates users even without any input data #88

Open slavafomin opened 9 years ago

slavafomin commented 9 years ago

Hello!

I'm developing a registration for local users in my app and I've encountered a strange behavior of the User.register function. When this function is called without any input data (e.g. {}) it still creates an empty new user without data, no errors are thrown.

Here's my controller action:

signUp: function (req, res) {
    return User.register(req.body)
      .then(function (user) {
        return res.json(user);
      })
      .catch(function (err) {
        return res.json(500, err);
      })
    ;
  }

When POSTed with empty body it produces this entity:

{
    "createdAt": "2015-09-02T09:49:25.980Z",
    "updatedAt": "2015-09-02T09:49:25.980Z",
    "id": 6
}
sylvainlap commented 9 years ago

:+1:

hacksut3l commented 8 years ago

+1

andreihod commented 8 years ago

+1