diff --git a/striker-ui-api/src/lib/request_handlers/auth/login.ts b/striker-ui-api/src/lib/request_handlers/auth/login.ts index 17e39653..9e687b78 100644 --- a/striker-ui-api/src/lib/request_handlers/auth/login.ts +++ b/striker-ui-api/src/lib/request_handlers/auth/login.ts @@ -7,13 +7,16 @@ export const login: RequestHandler = ( request, response, ) => { - const { user } = request; + const { session, user } = request; if (user) { const { name: userName } = user; stdout(`Successfully authenticated user [${userName}]`); + response.cookie(cname('session'), { + expires: session?.cookie?.expires, + }); response.cookie(cname('user'), user); } diff --git a/striker-ui-api/src/lib/request_handlers/auth/logout.ts b/striker-ui-api/src/lib/request_handlers/auth/logout.ts index a022059d..08106a4d 100644 --- a/striker-ui-api/src/lib/request_handlers/auth/logout.ts +++ b/striker-ui-api/src/lib/request_handlers/auth/logout.ts @@ -11,8 +11,9 @@ export const logout: RequestHandler = (request, response) => { return response.status(500).send(); } - response.clearCookie(cname('user')); + response.clearCookie(cname('session')); response.clearCookie(cname('sid')); + response.clearCookie(cname('user')); return response.status(204).send(); });