Skip to content

Commit

Permalink
Merge pull request #54 from akoo1010/master
Browse files Browse the repository at this point in the history
a test for redirection
  • Loading branch information
Diego Zuluaga committed Oct 10, 2015
2 parents 20aff36 + 6da9528 commit 8f118c2
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ console.log("authUrl: " + authUrl);
var redirect_uri = req.query.redirect_uri;
var basePath = utils.getBasePath(req);

if (auth_res.statusCode == 200){ // successful login returns 200

if (auth_res.statusCode == 200){ //successful login returns 200
//dynamically obtain the host and path for redirection to consent page
var host = utils.getHost(req);
var scheme = utils.getUrlScheme(req);
Expand All @@ -111,15 +110,27 @@ console.log("authUrl: " + authUrl);

// Store the username in the session for later use
req.session.user = username;
/* res.statusCode = 302;
res.header('Location', url);*/

/* with redirection
res.statusCode = 302;
res.header('Location', url);
res.header('Location', url);*/

//with no redirection
res.render('consent', {
basePath: basePath,
consentLink: url,
appname: appName,
scope: scope
});

}
console.log ('Redirecting to: ' + url);

}
res.end();

} else {
} else { //unsuccessful login returns 403 status code
console.log('Auth Response: ' + auth_res.statusCode + ' ' + data);
var regLink = basePath + '/register?';

Expand Down

0 comments on commit 8f118c2

Please sign in to comment.