i am a newbie api developer. For this i am using sailsjs. For authentication i am using sails-generate-auth. i have followed the doc in the github.
Here what i have done is:
// ProfileController:
home: function (req, res) {
Passport
.findOne({ protocol: 'local', user: req.user.id })
.exec(function(err, passport) {
return res.json({
todo: 'home() is not implemented yet! But you are logged in :)',
token: passport.accessToken
});
});
}
//config/policy.js
// '': true,
'': ['passport', 'sessionAuth'],
'Profile': {
'showAll': ['passport', 'bearerAuth','sessionAuth'],
},
'auth': {
'*': ['passport']
}
But i can not register. when i click http://localhost:1337/auth/register it redirects to http://localhost:1337/auth/local/register and says the page you are trying to reach does not exit.
Have i missed something in any file of the code??
Aucun commentaire:
Enregistrer un commentaire