feat: refactor admin authentication to staff authentication with updated cookie handling

This commit is contained in:
Ardeman
2025-03-03 16:47:59 +08:00
parent 4f4e94389e
commit 459e25c010
11 changed files with 120 additions and 90 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import { ADMIN_COOKIES, USER_COOKIES } from '~/configs/cookies'
import { STAFF_COOKIES, USER_COOKIES } from '~/configs/cookies'
export const setUserLogoutHeaders = () => {
const responseHeaders = new Headers()
@@ -10,11 +10,11 @@ export const setUserLogoutHeaders = () => {
return responseHeaders
}
export const setAdminLogoutHeaders = () => {
export const setStaffLogoutHeaders = () => {
const responseHeaders = new Headers()
responseHeaders.append(
'Set-Cookie',
`${ADMIN_COOKIES.token}=; Path=/lg-admin; HttpOnly; SameSite=Strict; Max-Age=0`,
`${STAFF_COOKIES.token}=; Path=/lg-admin; HttpOnly; SameSite=Strict; Max-Age=0`,
)
return responseHeaders