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 { urlLoginEndpoint, urlLoginSelectEndpoint, urlLogoutEndpoint } from "@/fetchers/index";
|
||||||
|
|
||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
import { setNewCompleteToRedis, getCompleteFromRedis } from "@/fetchers/custom/context/complete/fetch";
|
import { setNewCompleteToRedis } from "@/fetchers/custom/context/complete/fetch";
|
||||||
import {
|
import {
|
||||||
defaultValuesHeader,
|
defaultValuesHeader,
|
||||||
defaultValuesMenu,
|
defaultValuesMenu,
|
||||||
defaultValuesOnline,
|
defaultValuesOnline,
|
||||||
defaultValuesPageConfig,
|
defaultValuesPageConfig,
|
||||||
} from "@/fetchers/types/context";
|
} from "@/fetchers/types/context";
|
||||||
import { retrievePageList } from "@/fetchers/mutual/cookies/token";
|
|
||||||
import { deleteAllCookies } from "@/fetchers/mutual/cookies/cookie-actions";
|
import { deleteAllCookies } from "@/fetchers/mutual/cookies/cookie-actions";
|
||||||
import { setMenuToRedis } from "@/fetchers/custom/context/page/menu/fetch";
|
import { setMenuToRedis } from "@/fetchers/custom/context/page/menu/fetch";
|
||||||
import { LoginViaAccessKeys, LoginSelect } from "@/fetchers/types/login/validations";
|
import { LoginViaAccessKeys, LoginSelect } from "@/fetchers/types/login/validations";
|
||||||
import { retrieveValidUrlsOfRestriction } from "../restriction/fetch";
|
|
||||||
|
|
||||||
async function logoutActiveSession() {
|
async function logoutActiveSession() {
|
||||||
const response = await fetchDataWithToken(urlLogoutEndpoint, {}, "GET", false);
|
const response = await fetchDataWithToken(urlLogoutEndpoint, {}, "GET", false);
|
||||||
|
|
@ -136,20 +134,10 @@ async function loginViaAccessKeys(payload: LoginViaAccessKeys) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { completed: false, status: response.status || 500 };
|
||||||
completed: false,
|
|
||||||
// error: response.error || "Login failed",
|
|
||||||
// message: response.message || "Authentication failed",
|
|
||||||
status: response.status || 500,
|
|
||||||
};
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Login error:", error);
|
console.error("Login error:", error);
|
||||||
return {
|
return { completed: false, status: 500 };
|
||||||
completed: false,
|
|
||||||
// error: error instanceof Error ? error.message : "Login error",
|
|
||||||
// message: "An error occurred during login",
|
|
||||||
status: 500,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue