verifyTOTPWithHttpInfo method
Verify a TOTP or backup code for a user
Verify that the provided TOTP or backup code is valid for the user. Verifying a backup code will result it in being consumed (i.e. it will become invalid). Useful for custom auth flows and re-verification.
Note: This method returns the HTTP Response
.
Parameters:
-
String userId (required): The ID of the user for whom to verify the TOTP
-
VerifyTOTPRequest verifyTOTPRequest:
Implementation
Future<http.Response> verifyTOTPWithHttpInfo(
String userId, {
VerifyTOTPRequest? verifyTOTPRequest,
}) async {
// ignore: prefer_const_declarations
final path =
r'/users/{user_id}/verify_totp'.replaceAll('{user_id}', userId);
// ignore: prefer_final_locals
Object? postBody = verifyTOTPRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}