Open Eryoka opened 2 years ago
After a successful log in on the cas website, I am redirected to mywebiste.com/undefined
mywebiste.com/undefined
A sample that produces this error :
const express = require("express"); const app = express(); const session = require("express-session"); app.use(session({ secret : "test", resave : false, saveUninitialized : true, cookie : { maxAge : 60 * 60 * 1000, sameSite : "strict" } })); const casAuthentication = require("cas-authentication"); const cas = new casAuthentication({ cas_url : "https://caswebsite.com", service_url : "http://mywebsite.com", }); app.get("/", cas.bounce, (req, res) => { console.log(req.session); res.send("Hello, world!"); }); app.listen(80);
even if I can log in on cas website no session data is stored on my website, everytime I request mywebsite.com I get the cas login page.
mywebsite.com
By modifying the _handleTicket function as such :
_handleTicket
else { req.session[ this.session_name ] = user; if (this.session_info) { req.session[ this.session_info ] = attributes || {}; } res.send("connected"); }
The session data is stored and I can get the webpage after log in. No idea why the cas_return_to is undefined.
cas_return_to
After a successful log in on the cas website, I am redirected to
mywebiste.com/undefined
A sample that produces this error :
even if I can log in on cas website no session data is stored on my website, everytime I request
mywebsite.com
I get the cas login page.By modifying the
_handleTicket
function as such :The session data is stored and I can get the webpage after log in. No idea why the
cas_return_to
is undefined.