Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a test for redirection #54

Merged
merged 1 commit into from
Oct 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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