GuidesComponentsAuth Components

Password Reset

Let users request password recovery with the native SDK

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Use ResetPassword to collect an email address and request account recovery through the active native Ovok client. The SDK validates the form and handles loading, field errors, and supported rate limits. Your app owns the confirmation copy, support path, and navigation back to sign-in.

Compose a recovery screen

Render the screen below OvokProvider and the SDK ThemeProvider.

import { ResetPassword } from "@ovok/native";
import { Alert } from "react-native";

export function PasswordResetScreen() {
  return (
    <ResetPassword>
      <ResetPassword.Header>
        <ResetPassword.Header.Title />
        <ResetPassword.Header.Description />
      </ResetPassword.Header>

      <ResetPassword.Form
        type="Patient"
        onSuccess={() =>
          Alert.alert(
            "Check your email",
            "If the account can be recovered, instructions will be sent.",
          )
        }
        onError={() =>
          Alert.alert(
            "Request failed",
            "Try again. If the problem continues, contact support.",
          )
        }
      >
        <ResetPassword.Form.Inputs />
        <ResetPassword.Form.Button />
      </ResetPassword.Form>
    </ResetPassword>
  );
}

When type is omitted, the form defaults to Patient and shows the account type selector, which also offers Carer (RelatedPerson). Pass type="Patient", type="Practitioner" or type="RelatedPerson" to lock the form to one account type and hide the selector.

Use neutral confirmation copy

The built-in success callback currently receives a generic confirmation message. Keep the user-facing response neutral so the screen does not reveal whether an email address is registered. For custom recovery behavior, pass onSubmit; it replaces the default client.auth.resetPassword request.

Last updated on

On this page