updatePassword method

Future<Response> updatePassword({
  1. required String password,
  2. String? oldPassword,
})

Update Account Password

Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth and Team Invites, oldPassword is optional.

Implementation

Future<req.Response> updatePassword(
    {required String password, String? oldPassword}) {
  final String path = '/account/password';

  final Map<String, dynamic> params = {
    'password': password,
    'oldPassword': oldPassword,
  };

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

  return client.call(HttpMethod.patch,
      path: path, params: params, headers: headers);
}