Auth handles authentication of a single user, such as signing up, logging
in & out, social provider authentication, etc.
Link the user to this URL for password resets. Only for email/password authentication.
Use this if you want to use our password reset forms instead of creating your own in your app.
Check whether the user is logged in or not.
If an auth token exists in local storage, the user is logged in.
signup(details: UserDetails): Promise<void>
Sign up a user with the given data. Only for email/password authentication.
signup does not affect local data or the current user until
called. This means you’ll likely want to log in your users manually after
If a signup fails, the promise rejects with a
object that contains an array of error codes
from the cloud.
The details that describe a user.
login(moduleId: AuthModuleId, credentials?: Object, options?: AuthLoginOptions): Promise<AuthLoginResult>
Attempt to log the user in with the given credentials. For custom & social logins, kick-off the authentication process.
After login, the full user is loaded from the cloud and saved in local storage along with their auth token.
The authentication provider module ID to use with this login.
For email/password authentication, give an email and password. For social authentication, exclude this parameter. For custom authentication, send whatever you need.
Options for this login, such as whether to remember the login and InAppBrowser window options for authentication providers that make use of it.
Log the user out of the app.
This clears the auth token out of local storage and restores the user to an unauthenticated state.
requestPasswordReset(email: string): Promise<void>
Kick-off the password reset process. Only for email/password authentication.
An email will be sent to the user with a short password reset code, which
they can copy back into your app and use the
The email address to which to send a code.
confirmPasswordReset(code: number, newPassword: string): Promise<void>
Confirm a password reset.
When the user gives you their password reset code into your app and their requested changed password, call this method.
The password reset code from the user.
The requested changed password from the user.
getToken(): string |
Get the raw auth token of the active user from local storage.