summaryrefslogtreecommitdiff
path: root/src-migrate/modules/account-activation/components/FormOTP.tsx
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-31 10:44:25 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-31 10:44:25 +0700
commit6b221cccd58710682c99db7afbc29322da042880 (patch)
treeef659fa4400b045a21d91d60e2eecea3ec17537e /src-migrate/modules/account-activation/components/FormOTP.tsx
parent1602cff06e13bb03e5c48e8369abf5c803426e4d (diff)
- Add redirect after activation
- Add register form validation
Diffstat (limited to 'src-migrate/modules/account-activation/components/FormOTP.tsx')
-rw-r--r--src-migrate/modules/account-activation/components/FormOTP.tsx12
1 files changed, 2 insertions, 10 deletions
diff --git a/src-migrate/modules/account-activation/components/FormOTP.tsx b/src-migrate/modules/account-activation/components/FormOTP.tsx
index a4775d61..47c69329 100644
--- a/src-migrate/modules/account-activation/components/FormOTP.tsx
+++ b/src-migrate/modules/account-activation/components/FormOTP.tsx
@@ -54,8 +54,9 @@ const FormOTP = () => {
useEffect(() => {
if (mutationActivation.data?.user) {
setAuth(mutationActivation.data.user)
+ router.push((query?.redirect || '/') as string)
}
- }, [mutationActivation.data])
+ }, [mutationActivation.data, router, query.redirect])
return (
<Modal active={active} className="w-10/12 md:w-fit px-10" mode="desktop">
@@ -78,10 +79,6 @@ const FormOTP = () => {
<span className="text-red-700">Mohon maaf kode OTP yand anda masukan salah</span>
)
}
-
- {mutationActivation.data?.activation && (
- <span className="text-success-700">Akun anda berhasil diaktifkan, selamat berbelanja di Indoteknik.</span>
- )}
</div>
{!mutationActivation.data?.activation && (
@@ -108,11 +105,6 @@ const FormOTP = () => {
</>
)}
- {mutationActivation.data?.activation && (
- <Link href='/' className="text-success-700 underline">Kembali ke halaman utama</Link>
- )}
-
-
</div>
</div>
</Modal>