Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Megapixel99 committed Feb 2, 2021
1 parent a7599c2 commit 402fe01
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/passport-cas.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,19 @@ CasStrategy.prototype.authenticate = function(req, options) {
if (err) {
var date = new Date();
var token = Math.round(date.getTime() / 60000);
if (req.query['_cas_retry'] != token) {
// There was a CAS error. A common cause is when an old
// `ticket` portion of the querystring remains after the
// session times out and the user refreshes the page.
// So remove the `ticket` and try again.
var url = (req.originalUrl || req.url)
.replace(/_cas_retry=\d+&?/, '')
.replace(/([?&])ticket=[\w.-]+/, '$1_cas_retry='+token);
self.redirect(url, 307);
} else {
// Already retried. There is no way to recover from this.
self.fail(err);
}
// if (req.query['_cas_retry'] != token) {
// // There was a CAS error. A common cause is when an old
// // `ticket` portion of the querystring remains after the
// // session times out and the user refreshes the page.
// // So remove the `ticket` and try again.
// var url = (req.originalUrl || req.url)
// .replace(/_cas_retry=\d+&?/, '')
// .replace(/([?&])ticket=[\w.-]+/, '$1_cas_retry='+token);
// self.redirect(url, 307);
// } else {
// // Already retried. There is no way to recover from this.
// self.fail(err);
// }
}

// Validation successful
Expand Down

0 comments on commit 402fe01

Please sign in to comment.