generated from muhtadeetaron/nextjs-template
added exam routes
This commit is contained in:
@ -5,15 +5,17 @@ import { ChevronLeft, Layers } from "lucide-react";
|
||||
import { useTimer } from "@/context/TimerContext";
|
||||
import styles from "@/css/Header.module.css";
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000/api";
|
||||
const API_URL = "https://examjam-api.pptx704.com";
|
||||
|
||||
// You'll need to implement getToken for Next.js - could use cookies, localStorage, etc.
|
||||
const getToken = async () => {
|
||||
// Replace with your token retrieval logic
|
||||
if (typeof window !== "undefined") {
|
||||
return localStorage.getItem("token") || sessionStorage.getItem("token");
|
||||
if (typeof window === "undefined") {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
|
||||
// Extract authToken from cookies
|
||||
const match = document.cookie.match(/(?:^|;\s*)authToken=([^;]*)/);
|
||||
return match ? decodeURIComponent(match[1]) : null;
|
||||
};
|
||||
|
||||
const Header = ({
|
||||
|
||||
Reference in New Issue
Block a user