diff --git a/index.js b/index.js index a09fe0c..f134ea8 100644 --- a/index.js +++ b/index.js @@ -153,7 +153,8 @@ function CASAuthentication(options) { this.service_url = options.service_url; - this.renew = options.renew !== undefined ? !!options.renew : false; +// this.renew = options.renew !== undefined ? !!options.renew : false; + this.renew = options.renew === true ? true : false; this.is_dev_mode = options.is_dev_mode !== undefined ? !!options.is_dev_mode : false; this.dev_mode_user = options.dev_mode_user !== undefined ? options.dev_mode_user : ''; @@ -245,7 +246,7 @@ CASAuthentication.prototype._login = function(req, res, next) { // Save the return URL in the session. If an explicit return URL is set as a // query parameter, use that. Otherwise, just use the URL from the request. - req.session.cas_return_to = req.query.returnTo || url.parse(req.url).path; + req.session.cas_return_to = req.query.returnTo || url.parse(req.url).pathname; // Set up the query parameters. var query = { @@ -312,7 +313,7 @@ CASAuthentication.prototype._handleTicket = function(req, res, next) { ' \n' + ' \n' + ' \n' + ' \n' + ' ' + req.query.ticket + '\n' +