Fix: Middlerawe/2
This commit is contained in:
@@ -4,7 +4,8 @@ import { CheckCookies_UiLayout } from "@/app_modules/check_cookies";
|
|||||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CheckCookies_UiLayout>{children}</CheckCookies_UiLayout>
|
{children}
|
||||||
|
{/* <CheckCookies_UiLayout>{children}</CheckCookies_UiLayout> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,15 +41,14 @@ export default async function RootLayout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
// if (!token) return <>Require Token Storage</>;
|
||||||
|
// const userLoginId = await funGetUserIdByToken();
|
||||||
if (!token) return <>Require Token Storage</>;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RootStyleRegistry>
|
<RootStyleRegistry>
|
||||||
{/* <MqttLoader />
|
{/* <MqttLoader />
|
||||||
<TokenProvider token={token} envObject={envObject} /> */}
|
<TokenProvider token={token} envObject={envObject} /> */}
|
||||||
<RealtimeProvider userLoginId={userLoginId as string} />
|
{/* <RealtimeProvider userLoginId={userLoginId as string} /> */}
|
||||||
{children}
|
{children}
|
||||||
</RootStyleRegistry>
|
</RootStyleRegistry>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,16 +12,10 @@ export function middleware(request: NextRequest) {
|
|||||||
_.isEmpty(cookies?.value) ||
|
_.isEmpty(cookies?.value) ||
|
||||||
_.isUndefined(cookies?.value)
|
_.isUndefined(cookies?.value)
|
||||||
) {
|
) {
|
||||||
return NextResponse.redirect(new URL("/", request.url));
|
return NextResponse.redirect(new URL("/dev/auth/login", request.url));
|
||||||
}
|
}
|
||||||
|
|
||||||
// return NextResponse.redirect(new URL("/", request.url));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// See "Matching Paths" below to learn more
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: [
|
matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
|
||||||
|
|
||||||
"/((?!_next|static|favicon.ico|manifest).*)",
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user