resendOTP method

Future<OTPResponse> resendOTP({
  1. required String email,
})

Resend OTP for email

Implementation

Future<OTPResponse> resendOTP({
  required String email,
}) async {
  try {
    final response = await _apiClient.post<Map<String, dynamic>>(
      '/api/v1/auth/resend-otp',
      data: {
        'email': email,
      },
    );

    return OTPResponse.fromJson(response);
  } on ProdobitException {
    rethrow;
  } catch (e) {
    throw AuthException(
      'Failed to resend OTP: $e',
      code: 'OTP_RESEND_ERROR',
    );
  }
}