fix
Deskripsi: - Upload foto profil ke storage - Upload background profile ke storge ## No Issue
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function auth_funDeleteAktivasiKodeOtpById(otpId: string) {
|
||||
export async function auth_funDeleteAktivasiKodeOtpById({
|
||||
nomor,
|
||||
}: {
|
||||
nomor: string;
|
||||
}) {
|
||||
// console.log(otpId);
|
||||
const updt = await prisma.kodeOtp.delete({
|
||||
const updt = await prisma.kodeOtp.deleteMany({
|
||||
where: {
|
||||
id: otpId,
|
||||
nomor: nomor,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ export async function Auth_funRegister({
|
||||
data: any;
|
||||
HIPMI_PWD: string;
|
||||
}) {
|
||||
const pswd = process.env.WIBU_PWD as string;
|
||||
|
||||
|
||||
const cekUsername = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: data.username,
|
||||
@@ -39,14 +42,14 @@ export async function Auth_funRegister({
|
||||
username: create.username,
|
||||
}),
|
||||
{
|
||||
password: HIPMI_PWD,
|
||||
password: pswd,
|
||||
}
|
||||
);
|
||||
|
||||
cookies().set({
|
||||
name: "ssn",
|
||||
value: sealToken,
|
||||
// maxAge: 60 * 60 * 24 * 7,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
@@ -13,6 +13,9 @@ export async function auth_funValidasi({
|
||||
nomor: string;
|
||||
HIPMI_PWD: string;
|
||||
}) {
|
||||
const pswd = process.env.WIBU_PWD as string;
|
||||
|
||||
|
||||
const cekUser = await prisma.user.findUnique({
|
||||
where: {
|
||||
nomor: nomor,
|
||||
@@ -34,7 +37,7 @@ export async function auth_funValidasi({
|
||||
username: cekUser.username,
|
||||
}),
|
||||
{
|
||||
password: HIPMI_PWD,
|
||||
password: pswd,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function Register({ dataOtp }: { dataOtp: any }) {
|
||||
HIPMI_PWD: GlobalEnv.value?.WIBU_PWD as string,
|
||||
});
|
||||
if (res.status === 200) {
|
||||
await auth_funDeleteAktivasiKodeOtpById(dataOtp.id).then((val) => {
|
||||
await auth_funDeleteAktivasiKodeOtpById({ nomor: nomor }).then((val) => {
|
||||
if (val.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoading(true);
|
||||
|
||||
@@ -69,7 +69,9 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) {
|
||||
}
|
||||
|
||||
if (res.status === 401) {
|
||||
const resAktivasi = await auth_funDeleteAktivasiKodeOtpById(dataOtp.id);
|
||||
const resAktivasi = await auth_funDeleteAktivasiKodeOtpById({
|
||||
nomor: nomor,
|
||||
});
|
||||
if (resAktivasi.status === 200) {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
router.push(RouterAuth.login, { scroll: false });
|
||||
@@ -77,6 +79,11 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function onBack() {
|
||||
await auth_funDeleteAktivasiKodeOtpById({ nomor: nomor });
|
||||
router.back();
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<BackgroundImage
|
||||
@@ -93,7 +100,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) {
|
||||
top: 0,
|
||||
}}
|
||||
>
|
||||
<ActionIcon variant="transparent" onClick={() => router.back()}>
|
||||
<ActionIcon variant="transparent" onClick={() => onBack()}>
|
||||
<IconChevronLeft color="white" />
|
||||
</ActionIcon>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user