authom
authom copied to clipboard
Help setting Authom up in a SailsJS app
Could someone look over how I have configured Authom for my Sails app?
I created a policy called "authomAuth", which is "middleware" in Sails speak:
var authom = require('authom');
module.exports = function(req, res, next) {
authom.listener(req, res);
authom.on("auth", function(req, res, data) {
})
authom.on("error", function(req, res, data) {
})
console.log('Using authom policy');
return next();
};
I enabled the policy for the "AuthController" in the policy.config file
AuthController: {
'auth': 'authomAuth'
}
I then created a route as such:
'/auth/:service' : {
policy: 'authomAuth'
},
I have left out the forms for the meant time, is my configuration ok?
Thanks
i'm not really familiar with Sails, unfortunately. not sure i can help here... have you asked folks from that community?