Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Help setting Authom up in a SailsJS app #74

Open
kokujin opened this issue Aug 28, 2014 · 1 comment
Open

Help setting Authom up in a SailsJS app #74

kokujin opened this issue Aug 28, 2014 · 1 comment

Comments

@kokujin
Copy link

kokujin commented Aug 28, 2014

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

@jed
Copy link
Owner

jed commented Aug 29, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants