fix: login result handle changed to a singular function
This commit is contained in:
@@ -5,7 +5,7 @@ import DigitInput from '@/components/DigitsInput';
|
||||
import type { AuthMode, AuthType } from '../../types/authTypes';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { AuthenticationCard } from '../AuthenticationCard';
|
||||
import type { LoginRequest } from '../../types/userTypes';
|
||||
import type { LoginRequest, LoginResult } from '../../types/userTypes';
|
||||
import {
|
||||
loginOrSignUpWithOtp,
|
||||
sendEmailOtp,
|
||||
@@ -23,8 +23,7 @@ interface OtpVerifyFormProps {
|
||||
authType: AuthType;
|
||||
authMode: AuthMode;
|
||||
onEditValue: () => void;
|
||||
onOTPVerified: (userId: GUID) => void;
|
||||
onVerifyPhoneNumber: (userId: GUID) => void;
|
||||
onOTPVerified: (loginResult: LoginResult) => void;
|
||||
authReturnUrl: string;
|
||||
}
|
||||
|
||||
@@ -35,7 +34,6 @@ export function OtpVerifyForm({
|
||||
authMode,
|
||||
onEditValue,
|
||||
onOTPVerified,
|
||||
onVerifyPhoneNumber,
|
||||
authReturnUrl,
|
||||
}: OtpVerifyFormProps) {
|
||||
const [otpCode, setOtpCode] = useState<string>('');
|
||||
@@ -118,11 +116,7 @@ export function OtpVerifyForm({
|
||||
...tokenRes.data,
|
||||
});
|
||||
|
||||
if (res.registeredWithOutPhoneNumber) {
|
||||
onVerifyPhoneNumber(res.userId);
|
||||
} else {
|
||||
onOTPVerified(res.userId);
|
||||
}
|
||||
onOTPVerified(res);
|
||||
|
||||
toast({
|
||||
message:
|
||||
|
||||
Reference in New Issue
Block a user