addSecondFactorWithHttpInfo method
Future<Response>
addSecondFactorWithHttpInfo(
- String account,
- String user, {
- AddSecondFactorRequest? addSecondFactorRequest,
Add a second factor
Adds a new second factor for the user. After adding the second factor, it must be enabled via an update. To enable the second factor, a valid OTP must be provided.
Note: This method returns the HTTP Response
.
Parameters:
-
String account (required): The identifier (UUID) or slug of your Keygen account.
-
String user (required): The identifier (UUID) or email of the user the second factor is for.
-
AddSecondFactorRequest addSecondFactorRequest:
Implementation
Future<Response> addSecondFactorWithHttpInfo(String account, String user, { AddSecondFactorRequest? addSecondFactorRequest, }) async {
// ignore: prefer_const_declarations
final path = r'/accounts/{account}/users/{user}/second-factors'
.replaceAll('{account}', account)
.replaceAll('{user}', user);
// ignore: prefer_final_locals
Object? postBody = addSecondFactorRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/vnd.api+json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}