feat: integra microsserive de reviews
This commit is contained in:
@@ -8,6 +8,11 @@ const PROTECTED_ROUTES: AuthRouteRequirement[] = [
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/dashboard'
|
||||
},
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/api/profile/',
|
||||
prefix: true
|
||||
}
|
||||
]
|
||||
|
||||
@@ -37,8 +42,10 @@ export function getRouteRequirement(method: string, path: string): AuthRouteRequ
|
||||
const normalizedPath = normalizePath(path)
|
||||
|
||||
return (
|
||||
PROTECTED_ROUTES.find(
|
||||
(route) => route.method === normalizedMethod && route.path === normalizedPath
|
||||
) ?? null
|
||||
PROTECTED_ROUTES.find((route) => {
|
||||
if (route.method !== normalizedMethod) return false
|
||||
if (route.prefix) return normalizedPath.startsWith(route.path)
|
||||
return route.path === normalizedPath
|
||||
}) ?? null
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user