login select response completed tested
This commit is contained in:
parent
24b3ba1c7b
commit
dda9b1bb36
|
|
@ -8,7 +8,6 @@ import { NextResponse } from "next/server";
|
|||
export async function GET() {
|
||||
try {
|
||||
const menu = await getMenuFromRedis();
|
||||
console.log("menu", menu);
|
||||
return NextResponse.json({
|
||||
status: 200,
|
||||
data: menu,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ export async function POST(req: Request): Promise<NextResponse> {
|
|||
});
|
||||
}
|
||||
const userLogin = await loginViaAccessKeys(dataValidated);
|
||||
console.log("userLogin", userLogin);
|
||||
if (userLogin.status === 200 || userLogin.status === 202) {
|
||||
await initFirstSelection(
|
||||
userLogin.data?.firstSelection,
|
||||
|
|
|
|||
|
|
@ -54,9 +54,6 @@ interface UseMenuResult {
|
|||
export function useMenu(): UseMenuResult {
|
||||
const { data, availableItems, isLoading, error, refresh, update } =
|
||||
useContextMenu();
|
||||
console.log("data", data);
|
||||
console.log("availableItems", availableItems);
|
||||
|
||||
return {
|
||||
menuData: data,
|
||||
availableApplications: availableItems,
|
||||
|
|
|
|||
|
|
@ -39,11 +39,6 @@ async function checkContextDashUserInfo(): Promise<ClientUser> {
|
|||
// First try to use the server-side implementation
|
||||
try {
|
||||
const serverData = await getUserFromServer();
|
||||
console.log(
|
||||
"User data from server:",
|
||||
JSON.stringify(serverData, null, 2)
|
||||
);
|
||||
|
||||
// If we got valid data from the server, return it
|
||||
if (serverData && serverData.uuid) {
|
||||
// Check if we have a real user (not the default)
|
||||
|
|
|
|||
|
|
@ -44,10 +44,8 @@ const setActiveSelectionToRedis = async (selectionObject: any) => {
|
|||
}
|
||||
})
|
||||
if (oldData.online.userType.toUpperCase() === "EMPLOYEE") {
|
||||
console.log("selectionObject", selectionObject)
|
||||
await loginSelectEmployee({ uuid: selectionObject.uu_id });
|
||||
} else if (oldData.online.userType.toUpperCase() === "OCCUPANT") {
|
||||
console.log("selectionObject", selectionObject.build_living_space_uu_id)
|
||||
await loginSelectOccupant({ uuid: selectionObject.build_living_space_uu_id });
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ async function initRedis(loginRespone: any, firstSelection: any, accessToken: st
|
|||
async function initFirstSelection(firstSelection: any, userType: string) {
|
||||
if (userType === "EMPLOYEE") {
|
||||
const uuid = firstSelection.uu_id;
|
||||
console.log("uuid", uuid)
|
||||
await loginSelectEmployee({ uuid });
|
||||
} else if (userType === "OCCUPANT") {
|
||||
const uuid = firstSelection.build_living_space_uu_id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue