2025-02-27 19:37:31 +08:00
|
|
|
import { ADMIN_COOKIES, USER_COOKIES } from '~/configs/cookies'
|
2025-02-25 08:51:08 +08:00
|
|
|
|
|
|
|
|
export const setUserLogoutHeaders = () => {
|
|
|
|
|
const responseHeaders = new Headers()
|
|
|
|
|
responseHeaders.append(
|
|
|
|
|
'Set-Cookie',
|
2025-02-27 19:37:31 +08:00
|
|
|
`${USER_COOKIES.token}=; Path=/news; HttpOnly; SameSite=Strict; Max-Age=0`,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return responseHeaders
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const setAdminLogoutHeaders = () => {
|
|
|
|
|
const responseHeaders = new Headers()
|
|
|
|
|
responseHeaders.append(
|
|
|
|
|
'Set-Cookie',
|
|
|
|
|
`${ADMIN_COOKIES.token}=; Path=/admin; HttpOnly; SameSite=Strict; Max-Age=0`,
|
2025-02-25 08:51:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return responseHeaders
|
|
|
|
|
}
|