feat: update cookie paths for staff authentication and implement redirect logic in admin login
This commit is contained in:
@@ -15,5 +15,5 @@ export const staffTokenCookieConfig = createCookie(STAFF_COOKIES.token, {
|
||||
sameSite: 'lax',
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
secrets: [process.env.VITE_SALT_KEY || 'default-secret'],
|
||||
path: '/lg-admin',
|
||||
path: '/',
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@ export const setStaffLogoutHeaders = () => {
|
||||
const responseHeaders = new Headers()
|
||||
responseHeaders.append(
|
||||
'Set-Cookie',
|
||||
`${STAFF_COOKIES.token}=; Path=/lg-admin; HttpOnly; SameSite=Strict; Max-Age=0`,
|
||||
`${STAFF_COOKIES.token}=; Path=/; HttpOnly; SameSite=Strict; Max-Age=0`,
|
||||
)
|
||||
|
||||
return responseHeaders
|
||||
|
||||
Reference in New Issue
Block a user