updateRecovery method

Future<Token> updateRecovery({
  1. required String userId,
  2. required String secret,
  3. required String password,
  4. required String passwordAgain,
})

Create Password Recovery (confirmation)

Use this endpoint to complete the user account password reset. Both the userId and secret arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the POST /account/recovery endpoint.

Please note that in order to avoid a Redirect Attack the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

Implementation

Future<models.Token> updateRecovery(
    {required String userId,
    required String secret,
    required String password,
    required String passwordAgain}) async {
  const String path = '/account/recovery';

  final Map<String, dynamic> params = {
    'userId': userId,
    'secret': secret,
    'password': password,
    'passwordAgain': passwordAgain,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.put,
      path: path, params: params, headers: headers);

  return models.Token.fromMap(res.data);
}