authWithOTP method
Authenticate an auth record via OTP.
On success this method automatically updates the client's AuthStore.
Implementation
Future<RecordAuth> authWithOTP(
String otpId,
String password, {
String? expand,
String? fields,
Map<String, dynamic> body = const {},
Map<String, dynamic> query = const {},
Map<String, String> headers = const {},
}) {
final enrichedBody = Map<String, dynamic>.of(body);
enrichedBody["otpId"] ??= otpId;
enrichedBody["password"] ??= password;
final enrichedQuery = Map<String, dynamic>.of(query);
enrichedQuery["expand"] ??= expand;
enrichedQuery["fields"] ??= fields;
return client
.send<Map<String, dynamic>>(
"$baseCollectionPath/auth-with-otp",
method: "POST",
body: enrichedBody,
query: enrichedQuery,
headers: headers,
)
.then(_authResponse);
}