API reference › @evolu/web › PasskeyAuth

Defined in: packages/web/src/local-first/Passkey.ts:55

Unlocks the app's DeviceSecret with a passkey; see createPasskeyAuth.

Extends

Properties

startOver

readonly startOver: (options: {
  confirm: () => boolean | Promise<boolean>;
}) => Promise<void>;

Defined in: packages/web/src/local-first/Passkey.ts:83

Forgets the stored DeviceSecret or a setup's pending key, so the next PasskeyAuth.unlock creates another passkey and DeviceSecret, and resolves once the state says how it went. Call it while the state is Failed with canStartOver. A pending key wrapped no secret, so it's forgotten without asking; a stored secret is forgotten only once confirm, such as the app's dialog, returns true, because its device database's accounts then come back only from their backups. A confirm that throws or rejects, as a dialog library can when the user dismisses it, declines: the Run's reportDefect reports its error, and starting over stays offered.


state

readonly state: ReadonlyStore<PasskeyAuthState>;

Defined in: packages/web/src/local-first/Passkey.ts:62

What the app shows: not persisted, locked, unlocking, failed, starting over, or unlocked. A listener that throws doesn't stop an unlock or a start over: the Run's reportDefect reports its error, and the state changes anyway.


unlock

readonly unlock: () => Promise<void>;

Defined in: packages/web/src/local-first/Passkey.ts:70

Unlocks the stored DeviceSecret with its passkey, or on the first use creates a passkey and a DeviceSecret, and resolves once the state says how it went. Call it in a user gesture, while the state is Locked or Failed.

Methods

[asyncDispose]()

[asyncDispose](): PromiseLike<void>;

Defined in: node_modules/@typescript/old/lib/lib.esnext.disposable.d.ts:38

Inherited from

AsyncDisposable.[asyncDispose]