feat: add cookie management and HTTP client for user and admin authentication

This commit is contained in:
Ardeman
2025-02-25 08:51:08 +08:00
parent 0c38a775e3
commit c1bacacb49
7 changed files with 120 additions and 13 deletions
+13
View File
@@ -0,0 +1,13 @@
import { createCookie } from 'react-router'
import { ADMIN_COOKIES, USER_COOKIES } from '~/configs/storages'
export const userTokenCookie = createCookie(USER_COOKIES.token, {
secure: process.env.NODE_ENV === 'production',
path: '/news',
})
export const adminTokenCookie = createCookie(ADMIN_COOKIES.token, {
secure: process.env.NODE_ENV === 'production',
path: '/admin',
})