authom icon indicating copy to clipboard operation
authom copied to clipboard

Help setting Authom up in a SailsJS app

Open kokujin opened this issue 11 years ago • 1 comments

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

kokujin avatar Aug 28 '14 05:08 kokujin

i'm not really familiar with Sails, unfortunately. not sure i can help here... have you asked folks from that community?

jed avatar Aug 29 '14 00:08 jed