diff --git a/frontend/client-portal/src/contexts/LaravelAuthContext.tsx b/frontend/client-portal/src/contexts/LaravelAuthContext.tsx
index f78d2a81..f5c93a71 100755
--- a/frontend/client-portal/src/contexts/LaravelAuthContext.tsx
+++ b/frontend/client-portal/src/contexts/LaravelAuthContext.tsx
@@ -132,7 +132,7 @@ function AuthProvider({ children }: AuthProviderProps) {
const validateOtp = async (phoneOrEmail: string, otp: string) =>
axios
- .post('/verify-code', { otp })
+ .post('/verify-code', { phoneOrEmail: phoneOrEmail, otp })
.then((response) => {
const { user, token } = response.data.data;
setSession(token);
diff --git a/frontend/client-portal/src/pages/auth/Login.tsx b/frontend/client-portal/src/pages/auth/Login.tsx
index ca0ae3ea..f7275d8a 100755
--- a/frontend/client-portal/src/pages/auth/Login.tsx
+++ b/frontend/client-portal/src/pages/auth/Login.tsx
@@ -42,10 +42,10 @@ export default function Login() {
};
useEffect(() => {
- // if (state !== null) {
- // setFormPhone(state.formPhone);
- // }
- // console.log(state);
+ if (state !== null) {
+ setFormPhone(state.formPhone);
+ }
+ console.log(state);
}, [state]);
return (
diff --git a/frontend/client-portal/src/pages/auth/VerifyCode.tsx b/frontend/client-portal/src/pages/auth/VerifyCode.tsx
index 43cfacca..a5048f89 100755
--- a/frontend/client-portal/src/pages/auth/VerifyCode.tsx
+++ b/frontend/client-portal/src/pages/auth/VerifyCode.tsx
@@ -1,4 +1,4 @@
-import { Link as RouterLink, useLocation, useNavigate } from 'react-router-dom';
+import { useLocation, useNavigate } from 'react-router-dom';
// @mui
import { styled } from '@mui/material/styles';
import { Box, Card, Divider, IconButton, Grid, Link, Stack, Typography } from '@mui/material';
@@ -50,7 +50,7 @@ export default function VerifyCode() {
-
+
-
+
Masukkan kode OTP anda disini
-
+
+
+ Tidak mendapatkan kode?
+ Kirim Ulang Kode OTP
Atau
- {state.formPhone === false ? (
+ {state.formPhone ? (
- navigate('/auth/login', { state: { formPhone: state.formPhone } })
- }
+ onClick={() => navigate('/auth/login', { state: { formPhone: false } })}
>
- Masuk menggunakan nomor handphone
+ Masuk menggunakan email
) : (
- navigate('/auth/login', { state: { formPhone: state.formPhone } })
- }
+ onClick={() => navigate('/auth/login', { state: { formPhone: true } })}
>
- Masuk menggunakan email
+ Masuk menggunakan nomor handphone
)}
diff --git a/frontend/client-portal/src/sections/auth/verify-code/VerifyCodeForm.tsx b/frontend/client-portal/src/sections/auth/verify-code/VerifyCodeForm.tsx
index 3af436dc..c95c2a8c 100755
--- a/frontend/client-portal/src/sections/auth/verify-code/VerifyCodeForm.tsx
+++ b/frontend/client-portal/src/sections/auth/verify-code/VerifyCodeForm.tsx
@@ -7,7 +7,6 @@ import { useForm, Controller } from 'react-hook-form';
import { yupResolver } from '@hookform/resolvers/yup';
// @mui
import { OutlinedInput, Stack } from '@mui/material';
-import { LoadingButton } from '@mui/lab';
import useAuth from '../../../hooks/useAuth';
// routes
// import { PATH_DASHBOARD } from '../../../routes/paths';
@@ -21,9 +20,13 @@ type FormValuesProps = {
code4: string;
};
+type Props = {
+ phoneOrEmail: string;
+};
+
type ValueNames = 'code1' | 'code2' | 'code3' | 'code4';
-export default function VerifyCodeForm({ phoneOrEmail }: any) {
+export default function VerifyCodeForm({ phoneOrEmail }: Props) {
const navigate = useNavigate();
const { validateOtp } = useAuth();