Fix: Bug
This commit is contained in:
@@ -41,15 +41,15 @@ export default async function RootLayout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
// const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
if (!token) return <>Require Token Storage</>;
|
// 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
src/lib/middleware.ts
Normal file
12
src/lib/middleware.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import type { NextRequest } from "next/server";
|
||||||
|
|
||||||
|
// This function can be marked `async` if using `await` inside
|
||||||
|
export function middleware(request: NextRequest) {
|
||||||
|
return NextResponse.redirect(new URL("/home", request.url));
|
||||||
|
}
|
||||||
|
|
||||||
|
// See "Matching Paths" below to learn more
|
||||||
|
export const config = {
|
||||||
|
matcher: "/about/:path*",
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user