fix ( user access )

deskripsi:
- membatasi akses user yang hanya bisa di berikan oleh admin
This commit is contained in:
2025-01-10 08:49:30 +08:00
parent d0716bd859
commit abe92e4ad2
22 changed files with 744 additions and 218 deletions

View File

@@ -69,7 +69,7 @@ export default function Login({ version }: { version: string }) {
<Title order={3} c={MainColor.yellow}>
WELCOME TO
</Title>
<Title c={MainColor.yellow}>HIPMI APPS</Title>
<Title order={2} c={MainColor.yellow}>HIPMI BADUNG APPS</Title>
</Stack>
<Stack w={300}>

View File

@@ -13,6 +13,7 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
import Register_SkeletonView from "./skeleton";
import { clientLogger } from "@/util/clientLogger";
export default function Register() {
const router = useRouter();
@@ -70,28 +71,31 @@ export default function Register() {
await auth_funDeleteAktivasiKodeOtpByNomor({
nomor: data.nomor,
});
router.push("/dev/home", { scroll: false });
router.push("/waiting-room", { scroll: false });
return;
}
if (res.status === 400) {
setLoading(false);
ComponentGlobal_NotifikasiPeringatan(result.message);
return;
}
if (res.status === 405) {
setLoading(false);
ComponentGlobal_NotifikasiPeringatan(result.message);
return;
}
if (res.status === 500) {
setLoading(false);
ComponentGlobal_NotifikasiPeringatan(result.message);
return;
}
} catch (error) {
console.log(error);
} finally {
setLoading(false);
clientLogger.error("Error registrasi", error);
}
}

View File

@@ -87,9 +87,6 @@ export default function Validasi() {
body: JSON.stringify({
nomor: data.nomor,
}),
headers: {
"Content-Type": "application/json",
},
});
const result = await res.json();
@@ -100,6 +97,7 @@ export default function Validasi() {
await auth_funDeleteAktivasiKodeOtpByNomor({
nomor: data.nomor,
});
router.push(RouterHome.main_home, { scroll: false });
return;
}
@@ -110,30 +108,33 @@ export default function Validasi() {
await auth_funDeleteAktivasiKodeOtpByNomor({
nomor: data.nomor,
});
router.push(RouterAdminDashboard.splash_admin, { scroll: false });
return;
}
if (res.status === 404) {
setLoading(false);
router.push("/register", { scroll: false });
ComponentGlobal_NotifikasiBerhasil(result.message);
return;
}
if (res.status === 400) {
setLoading(false);
ComponentGlobal_NotifikasiPeringatan(result.message);
return;
}
if (res.status == 500) {
setLoading(false);
ComponentGlobal_NotifikasiGagal(result.message);
return;
}
} catch (error) {
clientLogger.error("Error validasi:", error);
} finally {
setLoading(false);
}
clientLogger.error("Error validasi:", error);
}
}
async function onBack() {