Skip to content

Commit

Permalink
update plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nijikokun committed Jul 22, 2013
1 parent f05d06a commit 74a30bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "guardian",
"version": "0.0.1",
"version": "0.0.2",
"description": "Authentication Gateway Proxy",
"main": "index.js",
"author": "Nijiko Yonskai",
Expand Down
16 changes: 10 additions & 6 deletions plugins/oauth_2_3-legged.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@ module.exports = {
1: {
invoke: function (options, server) {
var oauth = helper.getOAuth2(options);

server.res.redirect(oauth.getAuthorizeUrl({
var settings = {
redirect_uri: options.callbackUrl,
scope: options.scope || undefined,
state: options.state || undefined,
response_type: 'code'
}));
};

if (options.scope)
settings.scope = options.scope;

if (options.state)
settings.state = options.state;

server.res.redirect(oauth.getAuthorizeUrl(settings));
}
},


2: {
invoke: function (options, server) {
var oauth = helper.getOAuth2(options);
Expand Down

0 comments on commit 74a30bd

Please sign in to comment.