Why is it showing res.login is not a function?
<p>I'm trying <a href="https://github.com/sails101/basic-login" rel="nofollow noreferrer">this basic login</a>. The signup works fine but when I login on <code>http://localhost:1337/login</code> (when I enter values in the login form and submit, it shows the following error (the URL doesn't change):</p>

<p><strong>TypeError: res.login is not a function</strong></p>

<p>I tried to search on the net but couldn't find any solution. Is there any syntax error or I'm using old technology?</p>

<p>Here's the necessary code:</p>

<pre><code>module.exports = {
  login: function (req, res) {
    return res.login({
      email: req.param('email'),
      password: req.param('password'),
      successRedirect: '/',
      invalidRedirect: '/login'
    });
  },
  logout: function (req, res) {
    req.session.me = null;
    if (req.wantsJSON) {
      return res.ok('Logged out successfully!');
    }
    return res.redirect('/');
  },

  signup: function (req, res) {
    User.signup({
      name: req.param('name'),
      email: req.param('email'),
      password: req.param('password')
    }, function(err, user){
      if (err) return res.negotiate(err);
      req.session.me = user.id;
      return res.redirect('/welcome');
    });
  }
};
</code></pre>

<p>Model: <strong>User.js</strong></p>

<pre><code>module.exports = {

  attributes: {
    email: {
      type: 'email',
      required: true
    },
    password: {
      type: 'string',
      required: true
    }
  },

  signup : function(inputs, cb){
    User.create({
      name: inputs.name,
      email: inputs.email,
      password: inputs.password
    }).exec(cb);
  },

  attemptLogin: function(inputs, cb) {
    User.findOne({
      email: inputs.email,
      password: inputs.password
    }).exec(cb);
  }

};
</code></pre>

<p><strong>login.ejs</strong></p>

<pre><code>&lt;h1&gt;Login&lt;/h1&gt;
&lt;form action="/login" method="post"&gt;

  &lt;label for="email"&gt;Your email address?&lt;/label&gt;
  &lt;input name="email" type="text"/&gt;
  &lt;br/&gt;

  &lt;label for="password"&gt;Your safe word?&lt;/label&gt;
  &lt;input name="password" type="password"/&gt;
  &lt;br/&gt;
  &lt;input type="submit"/&gt;
&lt;/form&gt;
</code></pre>

<p><strong>routes.js</strong></p>

<pre><code> '/': {
    view: 'homepage'
  },
  'get /login' : {view : 'user/login'},
  'get /signup' : {view : 'user/signup'},
  'get /welcome' : {view: 'user/welcome'},
  'post /login' : 'UserController.login',
  'post /signup' : 'UserController.signup',
  '/logout' : 'UserController.logout'
</code></pre>