From 0a51f8d86498c50bec48648e9f61b64c1c9005df Mon Sep 17 00:00:00 2001 From: Corbadoman <100508310+corbadoman@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:17:23 +0200 Subject: [PATCH] Fix in example --- examples/detailed/session/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/detailed/session/index.js b/examples/detailed/session/index.js index d98a47e..8a2d812 100644 --- a/examples/detailed/session/index.js +++ b/examples/detailed/session/index.js @@ -16,20 +16,20 @@ router.get('/', async (_, res) => { }); router.get('/setCookie', async (req, res) => { - // You'll have to supply your own short session cookie value here. - // Bear in mind that the short session cookie value is only valid for 15 minutes. - // If you change the cookie name via config.setShortSessionCookieName, you'll + // You'll have to supply your own session-token here. + // Bear in mind that the session-token is only valid for 15 minutes. + // If you change the cookie name via config.setSessionTokenCookieName, you'll // have to update the cookie name here asa well. - const { shortSession } = await req.query; + const { sessionToken } = await req.query; - res.cookie('cbo_short_session', shortSession, { maxAge: 900000, httpOnly: true }); + res.cookie('cbo_session_token', sessionToken, { maxAge: 900000, httpOnly: true }); res.send('Cookie set!'); }); router.get('/logged-in', async (req, res) => { try { - const shortSession = await req.cookies.cbo_short_session; - const user = await sdk.sessions().validateToken(shortSession); + const sessionToken = await req.cookies.cbo_session_token; + const user = await sdk.sessions().validateToken(sessionToken); res.write(`User ID: ${user.userId}\n`); res.write(`User full name: ${user.fullName}\n`);