added exam routes

This commit is contained in:
shafin-r
2025-07-05 19:05:47 +06:00
parent 576398883d
commit 06418a82ab
8 changed files with 926 additions and 20 deletions

View File

@ -88,3 +88,13 @@ export const getTokenFromCookie = () => {
export const clearAuthToken = () => {
setCookie("authToken", null);
};
export const getToken = async () => {
if (typeof window === "undefined") {
return null;
}
// Extract authToken from cookies
const match = document.cookie.match(/(?:^|;\s*)authToken=([^;]*)/);
return match ? decodeURIComponent(match[1]) : null;
};