verifyEmail method
Verify email OTP
email
The email address of the user
otp
The OTP sent to the user's email
Implementation
Future<UserAndTokenResponse> verifyEmail({
required String email,
required String otp,
}) async {
try {
final response = await dio.post("/email-otp/verify-email", data: {"email": email, "otp": otp});
return UserAndTokenResponse.fromJson(response.data);
} catch (e) {
final message = getErrorMessage(e);
if (message == null) rethrow;
throw message;
}
}