fix folder
deskripsi: - ganti nama folder (user) ke (auth) - hapus folder auth
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
import { decrypt } from "../../../../app/auth/_lib/decrypt";
|
||||
import { decrypt } from "../../../../app/(auth)/_lib/decrypt";
|
||||
|
||||
export async function funGetUserIdByToken() {
|
||||
const SESSION_KEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!;
|
||||
|
||||
@@ -24,33 +24,27 @@ export default function Register() {
|
||||
const [isValue, setIsValue] = useState(false);
|
||||
const focusTrapRef = useFocusTrap();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [idCode, setIdCode] = useState("");
|
||||
|
||||
useShallowEffect(() => {
|
||||
const kodeId = localStorage.getItem("hipmi_auth_code_id");
|
||||
if (kodeId != null) {
|
||||
onCheckAuthCode({ kodeId: kodeId as string, onSetData: setNomor });
|
||||
onCheckAuthCode({ kodeId: kodeId as string });
|
||||
} else {
|
||||
console.log("code id not found");
|
||||
}
|
||||
}, [setNomor]);
|
||||
}, []);
|
||||
|
||||
async function onCheckAuthCode({
|
||||
kodeId,
|
||||
onSetData,
|
||||
}: {
|
||||
kodeId: string;
|
||||
onSetData: any;
|
||||
}) {
|
||||
async function onCheckAuthCode({ kodeId }: { kodeId: string }) {
|
||||
try {
|
||||
const respone = await apiGetCheckCodeOtp({ id: kodeId });
|
||||
if (respone) {
|
||||
onSetData(respone.nomor);
|
||||
setIdCode(kodeId);
|
||||
setNomor(respone.nomor);
|
||||
}
|
||||
} catch (error) {
|
||||
clientLogger.error("Error onCheckAuthCode:", error);
|
||||
}
|
||||
// const res = await fetch(`/api/auth/check?id=${kodeId}`);
|
||||
// const result = await res.json();
|
||||
}
|
||||
|
||||
async function onRegistarsi() {
|
||||
|
||||
@@ -181,18 +181,22 @@ export default function Validasi() {
|
||||
<>
|
||||
<UIGlobal_LayoutDefault>
|
||||
<Stack h={"100vh"}>
|
||||
<Box
|
||||
pt={"md"}
|
||||
px={"md"}
|
||||
style={{
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
}}
|
||||
>
|
||||
<ActionIcon variant="transparent" onClick={() => onBack()}>
|
||||
<IconChevronLeft color="white" />
|
||||
</ActionIcon>
|
||||
</Box>
|
||||
{data && data.nomor !== "" ? (
|
||||
<Box
|
||||
pt={"md"}
|
||||
px={"md"}
|
||||
style={{
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
}}
|
||||
>
|
||||
<ActionIcon variant="transparent" onClick={() => onBack()}>
|
||||
<IconChevronLeft color="white" />
|
||||
</ActionIcon>
|
||||
</Box>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
<Stack align="center" justify="center" h={"100vh"} spacing={50}>
|
||||
<Title order={2} color={MainColor.yellow}>
|
||||
|
||||
Reference in New Issue
Block a user