register method

Future<AuthResult> register(
  1. String identifier, [
  2. PasskeyCreationOptions? options
])

Attempts to create and register a new user with a passkey.

The method will try to register a user using the provided identifier which can be either an email address or a phone number.

Parameters:

  • identifier: Email address or phone for the user.
  • options: Optional configuration for passkey creation.

Returns: A Future<AuthResult> object that includes a redirect URL and saves the authorization token and (optional) refresh token securely to the device.

Throws: A PassageError in cases such as:

  • User cancels the operation
  • User already exists
  • App configuration was not done properly
  • etc.

Implementation

Future<AuthResult> register(String identifier,
    [PasskeyCreationOptions? options]) {
  return PassageFlutterPlatform.instance
   .registerWithPasskey(identifier, options);
}