Fixed Logging In Issue
This commit was merged in pull request #9.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
// import { cookies } from "next/headers";
|
||||
import { setCookie } from 'cookies-next';
|
||||
import Link from "next/link";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
@@ -79,18 +79,18 @@ const SignInForm = () => {
|
||||
}
|
||||
|
||||
// Store the token in cookies
|
||||
// const cookieStore = cookies();
|
||||
// cookieStore.set("cmc-profile", { ...res.profile }, { secure: true });
|
||||
// cookieStore.set("cmc-token", res.token, { secure: true });
|
||||
document.cookie = "cmc-token=" + res.token;
|
||||
await setCookie("cmc-token", res.token);
|
||||
router.push("/");
|
||||
|
||||
// setLoading(false);
|
||||
router.push("/");
|
||||
|
||||
console.log(res);
|
||||
} catch (error) {
|
||||
setLoading(false);
|
||||
console.log(error);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
setLoading(false);
|
||||
}, 5000);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const Layout = ({ children }) => {
|
||||
}, [router.pathname]);
|
||||
|
||||
// Debugging: Log the value of isAuthenticationPage
|
||||
console.log("isAuthenticationPage:", isAuthenticationPage, router.pathname);
|
||||
// console.log("isAuthenticationPage:", isAuthenticationPage, router.pathname);
|
||||
|
||||
const title = isAuthenticationPage ? "CMC - auth" : "CMC - dashboard";
|
||||
const mainWrapper = {
|
||||
|
||||
Reference in New Issue
Block a user