changeEmail method

  1. @override
Future<void> changeEmail(
  1. String newEmail
)

Changes the email address of a logged in user.

NOTE: This function requires that your project is configured with "NEW EMAIL VERIFICATION" turned OFF.

Throws an NhostException if changing emails fails.

Implementation

@override
Future<void> changeEmail(String newEmail) async {
  await _apiClient.post(
    '/user/email/change',
    jsonBody: {
      'newEmail': newEmail,
    },
    headers: _session.authenticationHeaders,
  );
}