login select response completed tested
This commit is contained in:
parent
0806ce9d65
commit
24b3ba1c7b
|
|
@ -5,18 +5,16 @@ import { cookieObject, tokenSecret } from "@/fetchers/base";
|
|||
import { urlLoginEndpoint, urlLoginSelectEndpoint, urlLogoutEndpoint } from "@/fetchers/index";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
import { setNewCompleteToRedis, getCompleteFromRedis } from "@/fetchers/custom/context/complete/fetch";
|
||||
import { setNewCompleteToRedis } from "@/fetchers/custom/context/complete/fetch";
|
||||
import {
|
||||
defaultValuesHeader,
|
||||
defaultValuesMenu,
|
||||
defaultValuesOnline,
|
||||
defaultValuesPageConfig,
|
||||
} from "@/fetchers/types/context";
|
||||
import { retrievePageList } from "@/fetchers/mutual/cookies/token";
|
||||
import { deleteAllCookies } from "@/fetchers/mutual/cookies/cookie-actions";
|
||||
import { setMenuToRedis } from "@/fetchers/custom/context/page/menu/fetch";
|
||||
import { LoginViaAccessKeys, LoginSelect } from "@/fetchers/types/login/validations";
|
||||
import { retrieveValidUrlsOfRestriction } from "../restriction/fetch";
|
||||
|
||||
async function logoutActiveSession() {
|
||||
const response = await fetchDataWithToken(urlLogoutEndpoint, {}, "GET", false);
|
||||
|
|
@ -136,20 +134,10 @@ async function loginViaAccessKeys(payload: LoginViaAccessKeys) {
|
|||
}
|
||||
}
|
||||
|
||||
return {
|
||||
completed: false,
|
||||
// error: response.error || "Login failed",
|
||||
// message: response.message || "Authentication failed",
|
||||
status: response.status || 500,
|
||||
};
|
||||
return { completed: false, status: response.status || 500 };
|
||||
} catch (error) {
|
||||
console.error("Login error:", error);
|
||||
return {
|
||||
completed: false,
|
||||
// error: error instanceof Error ? error.message : "Login error",
|
||||
// message: "An error occurred during login",
|
||||
status: 500,
|
||||
};
|
||||
return { completed: false, status: 500 };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue