From 9f129f2fd2b9de892c9260e0ac06108382819873 Mon Sep 17 00:00:00 2001 From: "Seth Wheeler (Student)" Date: Tue, 2 Feb 2021 13:51:05 -0800 Subject: [PATCH] update url --- lib/passport-cas.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/passport-cas.js b/lib/passport-cas.js index 111718a..540c34d 100644 --- a/lib/passport-cas.js +++ b/lib/passport-cas.js @@ -168,7 +168,8 @@ CasStrategy.prototype.authenticate = function(req, options) { if (!ticket) { // Redirect to CAS server for authentication - self.redirect(`${self.casBaseUrl}/login?service=${encodeURIComponent(service)}/?_cas_retry=${Math.round(date.getTime() / 60000)}`, 307); + var date = new Date(Date.now()); + self.redirect(`${self.casBaseUrl}/login?service=${encodeURIComponent(`${service}/?_cas_retry=${Math.round(date.getTime() / 60000)}`)}`, 307); } else { // User has returned from CAS site with a ticket @@ -176,7 +177,7 @@ CasStrategy.prototype.authenticate = function(req, options) { // Ticket validation failed if (err) { - var date = new Date(); + var date = new Date(Date.now()); 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