0

Currently my routes look like this

  'get /login': 'LoginController.showForm',
  'post /login': 'LoginController.processForm'

So going to /login and submitting a form redirects me to /login with method POST but I get this error

You don't have permission to see the page you're trying to reach. 

The controller file looks like this

module.exports = {

    showForm: function(req, res) {

        return res.view('login/form');
    },
    processForm: function(req, res) {

        return res.send('works')
    }
}

Config policies

module.exports.policies = {

  LoginController: {

  } 
};
Raggaer
  • 3,244
  • 8
  • 36
  • 67

1 Answers1

0

It appears you have a policy in place that is causing this. But if you have not done anything with them you should have no policy in place to do this.

Without knowing more about your code, I'm left with giving you these links and encouraging you to check out your policies.

http://sailsjs.org/#!/documentation/concepts/Policies http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.policies.html

Update your config/policies.js file

module.exports.policies = { 
  LoginController: {
   '*':true
  } 
};
Meeker
  • 5,979
  • 2
  • 20
  • 38