diff --git a/apps/portal/src/app/features/auth/pages/LoginPage.tsx b/apps/portal/src/app/features/auth/pages/LoginPage.tsx index 78b62e3cd..0db2de1d3 100644 --- a/apps/portal/src/app/features/auth/pages/LoginPage.tsx +++ b/apps/portal/src/app/features/auth/pages/LoginPage.tsx @@ -67,7 +67,7 @@ export function LoginPage() { }).unwrap(); dispatch(setUser(me)); - if (me.status === 'accepted') { + if (me.isPhoneNumberVerified) { navigate('/dashboard'); } else { navigate('/otp-verify', { diff --git a/apps/portal/src/app/features/auth/pages/OTPVerificationPage.tsx b/apps/portal/src/app/features/auth/pages/OTPVerificationPage.tsx index c095b68e1..b1c3a730e 100644 --- a/apps/portal/src/app/features/auth/pages/OTPVerificationPage.tsx +++ b/apps/portal/src/app/features/auth/pages/OTPVerificationPage.tsx @@ -3,6 +3,7 @@ import { Anchor, Button, Center, + Divider, Group, PinInput, Stack, @@ -153,6 +154,21 @@ export function OTPVerificationPage() { + + + +
diff --git a/apps/portal/src/app/features/auth/pages/SignupPage.tsx b/apps/portal/src/app/features/auth/pages/SignupPage.tsx index d12d1ad6b..a6499dc19 100644 --- a/apps/portal/src/app/features/auth/pages/SignupPage.tsx +++ b/apps/portal/src/app/features/auth/pages/SignupPage.tsx @@ -105,9 +105,13 @@ export function SignupPage() { }), ); - navigate('/otp-verify', { - state: { email: values.email, phoneNumber: values.phoneNumber }, - }); + if (data.isPhoneNumberVerified) { + navigate('/dashboard'); + } else { + navigate('/otp-verify', { + state: { email: values.email, phoneNumber: values.phoneNumber }, + }); + } } catch (err) { const msg = err instanceof Error ? err.message : 'Something went wrong'; notify.error(msg); diff --git a/apps/portal/src/app/features/auth/types/auth.types.ts b/apps/portal/src/app/features/auth/types/auth.types.ts index d4a09b428..7163f3d72 100644 --- a/apps/portal/src/app/features/auth/types/auth.types.ts +++ b/apps/portal/src/app/features/auth/types/auth.types.ts @@ -12,6 +12,7 @@ export interface AuthUser { hasSetPassword: boolean; hasFinishedRegistration: boolean; hasFinishedDMSOnboarding: boolean; + isPhoneNumberVerified: boolean; } export interface AuthState {