Fix: Middlerawe/1
This commit is contained in:
@@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
cookies().set({
|
||||
name: "ssn",
|
||||
name: "mySession",
|
||||
value: "",
|
||||
maxAge: 0,
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function POST(req: Request) {
|
||||
);
|
||||
|
||||
cookies().set({
|
||||
name: "ssn",
|
||||
name: "mySession",
|
||||
value: seal,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
});
|
||||
|
||||
@@ -35,10 +35,9 @@ export async function POST(req: Request) {
|
||||
);
|
||||
|
||||
cookies().set({
|
||||
name: "ssn",
|
||||
name: "mySession",
|
||||
value: res,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
|
||||
});
|
||||
|
||||
revalidatePath("/dev/home");
|
||||
|
||||
@@ -4,7 +4,7 @@ import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const cekCookies = cookies();
|
||||
const c = cekCookies.get("ssn");
|
||||
const c = cekCookies.get("mySession");
|
||||
|
||||
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
||||
return NextResponse.json({ success: false });
|
||||
|
||||
@@ -41,15 +41,15 @@ export default async function RootLayout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
// const userLoginId = await funGetUserIdByToken();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
// if (!token) return <>Require Token Storage</>;
|
||||
if (!token) return <>Require Token Storage</>;
|
||||
|
||||
return (
|
||||
<RootStyleRegistry>
|
||||
{/* <MqttLoader />
|
||||
<TokenProvider token={token} envObject={envObject} /> */}
|
||||
{/* <RealtimeProvider userLoginId={userLoginId as string} /> */}
|
||||
<RealtimeProvider userLoginId={userLoginId as string} />
|
||||
{children}
|
||||
</RootStyleRegistry>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user