UNPKG

@react-native-ohos/realm

Version:

Realm by MongoDB is an offline-first mobile database: an alternative to SQLite and key-value stores

89 lines (88 loc) 3.6 kB
import type { binding } from "../binding"; /** * Authentication provider where users identify using email and password. * @see https://www.mongodb.com/docs/atlas/app-services/authentication/email-password/ */ export declare class EmailPasswordAuth { /** @internal */ internal: binding.UsernamePasswordProviderClient; /** @internal */ constructor(internal: binding.UsernamePasswordProviderClient); /** * Registers a new email identity with the email/password provider, * and sends a confirmation email to the provided address. * @param details - The new user's email and password details. * @param details.email - The email address of the user to register. * @param details.password - The password that the user created for the new username/password identity. * @since v10.10.0 */ registerUser(details: { email: string; password: string; }): Promise<void>; /** * Confirms an email identity with the email/password provider. * @param details - The received token and ID details * @param details.token - The confirmation token that was emailed to the user. * @param details.tokenId - The confirmation token id that was emailed to the user. * @since v10.10.0 */ confirmUser(details: { token: string; tokenId: string; }): Promise<void>; /** * Re-sends a confirmation email to a user that has registered but * not yet confirmed their email address. * @param details - The associated email details. * @param details.email - The email address of the user to re-send a confirmation for. * @since v10.10.0 */ resendConfirmationEmail(details: { email: string; }): Promise<void>; /** * Re-run the custom confirmation function for user that has registered but * not yet confirmed their email address. * @param details - The associated email details. * @param details.email - The email address of the user to re-run the confirmation for. * @since v10.10.0 */ retryCustomConfirmation(details: { email: string; }): Promise<void>; /** * Resets the password of an email identity using the password reset token emailed to a user. * @param details - The token and password details for the reset. * @param details.password - The desired new password. * @param details.token - The password reset token that was emailed to the user. * @param details.tokenId - The password reset token id that was emailed to the user. * @since v10.10.0 */ resetPassword(details: { password: string; token: string; tokenId: string; }): Promise<void>; /** * Sends an email to the user for resetting the password. * @param details - The email details to send the reset to. * @param details.email - The email address of the user to re-send a confirmation for. * @since v10.10.0 */ sendResetPasswordEmail(details: { email: string; }): Promise<void>; /** * Call the custom function to reset the password. * @param details - The new user's email and password details. * @param details.email - The email address of the user to register. * @param details.password - The password that the user created for the new username/password identity. * @param args One or more arguments to pass to the function. * @since v10.10.0 */ callResetPasswordFunction(details: { email: string; password: string; }, ...args: unknown[]): Promise<void>; }