diff --git a/src/client/components/LoginForm.tsx b/src/client/components/LoginForm.tsx index c92dd8d72..424c48879 100644 --- a/src/client/components/LoginForm.tsx +++ b/src/client/components/LoginForm.tsx @@ -71,35 +71,38 @@ export const LoginForm: FC = ({ email, onLogin }) => { ) } - const hasError = () => errors.email || auth.verifyOtp.isError + const hasError = (): boolean => !!errors.token || auth.verifyOtp.isError const getErrorMessage = (): string => { - const { otp } = errors - return otp && otp.type === 'required' + return errors && errors.token ? 'Please provide a valid OTP' - : getApiErrorMessage(auth.verifyOtp.error) + : auth.verifyOtp.isError + ? getApiErrorMessage(auth.verifyOtp.error) + : '' } return (
- - One time password + + + One time password + Please enter the OTP sent to {email}. - {hasError() && ( - {getErrorMessage()} - )} +