feat: refactor admin authentication to staff authentication with updated cookie handling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user