verifyOtp method

Future<PhoneVerifyResult> verifyOtp({
  1. required String phoneNumber,
  2. required String code,
})

Verify the OTP code and complete sign-in. If no user exists with this phone, one is created. The returned PhoneVerifyResult.isNewUser flag lets the app route first-time users to onboarding.

Implementation

Future<PhoneVerifyResult> verifyOtp({
  required String phoneNumber,
  required String code,
}) async {
  final result = await _api.verifyOtp(phoneNumber: phoneNumber, code: code);
  await _setSession(result.session);
  return result;
}