Reputation: 355
I'm using the oauth.io node sdk for server side authentication and I want to authorise multiple providers on my app, I'm just wondering if there is a way of doing it without having to create a separate endpoint for each one.
Something like this is what I'm after but the authorisation function doesn't seem to work when wrapped in a container function.
app.get('/signin', function(req, res){
OAuth.auth(req.param.provider, 'http://localhost:8080/oauth/redirect')
});
Upvotes: 0
Views: 46
Reputation: 355
Found answer thanks to thyb in this post
https://github.com/oauth-io/sdk-node/issues/14
app.get('/signin/:provider', function(req, res) {
OAuth.auth(req.param.provider, 'http://localhost:8080/oauth/redirect')(req, res);
});
Upvotes: 0