sendResetPwdEmail method

Future<APIError?> sendResetPwdEmail(
  1. String email
)

Sends an email with a link to reset password.

This method works only if email confirmation is enabled in your app authentication settings and the user's email address has already been verified.

When the user clicks on the link in email, Altogic verifies the validity of the reset-password link and if successful redirects the user to the redirect URL specified in you app authentication settings with an access token in a query string parameter named 'access_token.' At this state your app needs to detect action=reset-pwd in the redirect URL and display a password reset form to the user. After getting the new password from the user, you can call resetPwdWithToken method with the access token and new password to change the password of the user.

If email confirmation is disabled in your app authentication settings or if the user's email has not been verified, it returns an error.

email The email address of the user to send the verification email.

Implementation

Future<APIError?> sendResetPwdEmail(String email) async => (await _fetcher
        .post<dynamic>('/_api/rest/v1/auth/send-reset?email=$email'))
    .errors;