changePassword method

  1. @override
Future<void> changePassword({
  1. required String newPassword,
  2. String? ticket,
})

Changes the password of the logged in user.

Throws an NhostException if changing passwords fails.

Implementation

@override
Future<void> changePassword({
  required String newPassword,
  String? ticket,
}) async {
  await _apiClient.post(
    '/user/password',
    jsonBody: {
      'newPassword': newPassword,
      if (ticket != null) 'ticket': ticket
    },
    headers: _session.authenticationHeaders,
  );
}