feat: update admin routes and cookie paths to use '/lg-admin' prefix
This commit is contained in:
parent
5f1fd8b1a2
commit
3f9bfded80
@ -18,11 +18,11 @@ export const META_TITLE_CONFIG: TMetaTitleConfig = [
|
|||||||
title: 'Home',
|
title: 'Home',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/admin/auth/login',
|
path: '/lg-admin/auth/login',
|
||||||
title: 'Login',
|
title: 'Login',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/admin/auth/register',
|
path: '/lg-admin/auth/register',
|
||||||
title: 'Register',
|
title: 'Register',
|
||||||
},
|
},
|
||||||
...ADMIN_MENU.flatMap((menu) =>
|
...ADMIN_MENU.flatMap((menu) =>
|
||||||
|
|||||||
@ -25,27 +25,27 @@ export const MENU: TMenu[] = [
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: 'Dashboard',
|
title: 'Dashboard',
|
||||||
url: '/admin/dashboard',
|
url: '/lg-admin',
|
||||||
icon: ChartIcon,
|
icon: ChartIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'User',
|
title: 'User',
|
||||||
url: '/admin/dashboard/users',
|
url: '/lg-admin/users',
|
||||||
icon: DocumentIcon,
|
icon: DocumentIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Konten',
|
title: 'Konten',
|
||||||
url: '/admin/dashboard/contents',
|
url: '/lg-admin/contents',
|
||||||
icon: ChatIcon,
|
icon: ChatIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Advertisement',
|
title: 'Advertisement',
|
||||||
url: '/admin/dashboard/advertisements',
|
url: '/lg-admin/advertisements',
|
||||||
icon: MedicalNotesIcon,
|
icon: MedicalNotesIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Subscription',
|
title: 'Subscription',
|
||||||
url: '/admin/dashboard/subscriptions',
|
url: '/lg-admin/subscriptions',
|
||||||
icon: ChartIcon,
|
icon: ChartIcon,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -55,17 +55,17 @@ export const MENU: TMenu[] = [
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: 'Data Situs',
|
title: 'Data Situs',
|
||||||
url: '/admin/dashboard/site-data',
|
url: '/lg-admin/site-data',
|
||||||
icon: WalletIcon,
|
icon: WalletIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Pengaturan',
|
title: 'Pengaturan',
|
||||||
url: '/admin/dashboard/settings',
|
url: '/lg-admin/settings',
|
||||||
icon: SettingIcon,
|
icon: SettingIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Admin',
|
title: 'Admin',
|
||||||
url: '/admin/dashboard/admins',
|
url: '/lg-admin/admins',
|
||||||
icon: ProfileIcon,
|
icon: ProfileIcon,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@ -15,5 +15,5 @@ export const adminTokenCookieConfig = createCookie(ADMIN_COOKIES.token, {
|
|||||||
sameSite: 'lax',
|
sameSite: 'lax',
|
||||||
secure: process.env.NODE_ENV === 'production',
|
secure: process.env.NODE_ENV === 'production',
|
||||||
secrets: [process.env.VITE_SALT_KEY || 'default-secret'],
|
secrets: [process.env.VITE_SALT_KEY || 'default-secret'],
|
||||||
path: '/admin',
|
path: '/lg-admin',
|
||||||
})
|
})
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export const setAdminLogoutHeaders = () => {
|
|||||||
const responseHeaders = new Headers()
|
const responseHeaders = new Headers()
|
||||||
responseHeaders.append(
|
responseHeaders.append(
|
||||||
'Set-Cookie',
|
'Set-Cookie',
|
||||||
`${ADMIN_COOKIES.token}=; Path=/admin; HttpOnly; SameSite=Strict; Max-Age=0`,
|
`${ADMIN_COOKIES.token}=; Path=/lg-admin; HttpOnly; SameSite=Strict; Max-Age=0`,
|
||||||
)
|
)
|
||||||
|
|
||||||
return responseHeaders
|
return responseHeaders
|
||||||
|
|||||||
@ -12,7 +12,7 @@ const AuthLayout = () => {
|
|||||||
<div className="flex min-h-dvh min-w-dvw flex-col items-center justify-center space-y-8">
|
<div className="flex min-h-dvh min-w-dvw flex-col items-center justify-center space-y-8">
|
||||||
<div className="grid max-w-lg items-center justify-center space-y-7 rounded-[20px] border border-[#E6E6E6] bg-white p-8">
|
<div className="grid max-w-lg items-center justify-center space-y-7 rounded-[20px] border border-[#E6E6E6] bg-white p-8">
|
||||||
<div className="flex flex-col items-center">
|
<div className="flex flex-col items-center">
|
||||||
<Link to="/admin/dashboard">
|
<Link to="/lg-admin">
|
||||||
<img
|
<img
|
||||||
src={APP.logo}
|
src={APP.logo}
|
||||||
alt={APP.title}
|
alt={APP.title}
|
||||||
@ -76,7 +76,7 @@ const AuthLayout = () => {
|
|||||||
<div className="mb-4 flex justify-between">
|
<div className="mb-4 flex justify-between">
|
||||||
<span className="text-gray-600">Lupa Kata Sandi?</span>
|
<span className="text-gray-600">Lupa Kata Sandi?</span>
|
||||||
<Link
|
<Link
|
||||||
to="/admin/auth/reset-password"
|
to="/lg-admin/auth/reset-password"
|
||||||
className="font-semibold text-[#2E2F7C]"
|
className="font-semibold text-[#2E2F7C]"
|
||||||
>
|
>
|
||||||
Reset Kata Sandi
|
Reset Kata Sandi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user