feat: add cookie management and HTTP client for user and admin authentication
This commit is contained in:
@@ -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',
|
||||
})
|
||||
Reference in New Issue
Block a user