registerWithPhone method

Future<bool> registerWithPhone(
  1. PhoneRegisterRequest request
)
inherited

Step 3b: Register a new user via the phone OTP flow.

Implementation

Future<bool> registerWithPhone(PhoneRegisterRequest request) async {
  state = state.copyWith(status: AuthStatus.authenticating, error: null);
  try {
    final tokens = await _authService.register(request.toJson());
    await _applyTokens(tokens);
    return true;
  } on DioException catch (e) {
    _handleError(e);
    return false;
  }
}