Skip to content

Commit

Permalink
Added resave to fix issues of session expiry (#30)
Browse files Browse the repository at this point in the history
* Added resave to fix session expiry issues

* Added touch instead of resave

* Added test for accessing multiple sites
  • Loading branch information
rorylshanks authored Mar 19, 2024
1 parent cfa0db9 commit f62adae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/sso.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ async function redirectToSsoProvider(req, res) {
var redirectBasePath = getRedirectBasepath()

if (req.session.loggedin) {
req.session.touch()
let jwtPayload = {
protocol: redirectToken.protocol,
host: redirectToken.host,
Expand Down
10 changes: 9 additions & 1 deletion test/e2e/tests/basic_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,12 @@ Scenario('Dynamic Upstreams Test SRV', async ({ I }) => {
Scenario('Unauthenticated Access test', async ({ I }) => {
I.amOnPage('http://test-unauthenticated-access.localtest.me/get');
I.see("x-public-access")
});
});

Scenario('Multiple site access without login', async ({ I }) => {
I.amOnPage('http://test-basic-login.localtest.me/get');
I.login();
I.see("x-veriflow-user-id")
I.amOnPage('http://test-https-upstream.localtest.me/get');
I.see("x-veriflow-user-id")
});

0 comments on commit f62adae

Please sign in to comment.