Interface: MincaAuth
Defined in: packages/core/src/session/auth.ts:408
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
staySignedIn | readonly | object | - | packages/core/src/session/auth.ts:556 |
staySignedIn.choice | public | () => StaySignedIn | - | packages/core/src/session/auth.ts:557 |
staySignedIn.setChoice | public | (choice) => Promise<void> | - | packages/core/src/session/auth.ts:558 |
staySignedIn.until | public | () => Date | null | - | packages/core/src/session/auth.ts:559 |
usernames | readonly | string | null | Where new accounts take usernames (usernames in the config); null when none are offered | packages/core/src/session/auth.ts:439 |
Methods
acceptPairing()
acceptPairing(): Promise<void>;Defined in: packages/core/src/session/auth.ts:457
Meets the computer the pairing link names. Signed in to another account,
it stops once the account arrives and sets pairingArrival: answer with
answerPairing.
Returns
Promise<void>
addPasskey()
addPasskey(): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:466
Adds a passkey for this site. During setup, moves the flow on; otherwise needs confirm first.
Returns
Promise<boolean>
answerPairing()
answerPairing(take): Promise<void>;Defined in: packages/core/src/session/auth.ts:459
Takes the account a pairing brought (added, or switched to if already here), or lets it go
Parameters
| Parameter | Type |
|---|---|
take | boolean |
Returns
Promise<void>
cancelPod()
cancelPod(): void;Defined in: packages/core/src/session/auth.ts:471
Returns
void
choosePod()
choosePod(): Promise<void>;Defined in: packages/core/src/session/auth.ts:419
Opens a pod. Needs a click. Signed in, it asks what should happen to the data first (podChoice).
Returns
Promise<void>
clearError()
clearError(): void;Defined in: packages/core/src/session/auth.ts:461
Returns
void
codeSaved()
codeSaved(): void;Defined in: packages/core/src/session/auth.ts:447
The recovery code has been kept somewhere safe; on to choosing a way in
Returns
void
confirm()
confirm(proof): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:490
Asks the person to prove it is them, with the account's password, a
passkey on this device or the recovery code, even though they are signed
in: a page left open, or a sign-in kept for days, is no proof anyone is
there. For a few minutes after, the recovery code can be read and the
account offered to a phone. A wrong answer sets error.
Parameters
| Parameter | Type |
|---|---|
proof | | { password: string; } | { passkey: true; } | { code: string; } |
Returns
Promise<boolean>
confirmPod()
confirmPod(how): Promise<void>;Defined in: packages/core/src/session/auth.ts:470
Parameters
| Parameter | Type |
|---|---|
how | "combine" | "switch" |
Returns
Promise<void>
connectedElsewhere()
connectedElsewhere(origin): readonly object[];Defined in: packages/core/src/session/auth.ts:533
Other accounts in this place that a carrier at origin is connected to from this home.
One browser extension carries one account, so connecting it here moves it
off theirs — worth saying before it happens.
Parameters
| Parameter | Type |
|---|---|
origin | string |
Returns
readonly object[]
connections()
connections(): readonly Connection[];Defined in: packages/core/src/session/auth.ts:527
Apps this account is connected to from this home, newest first
Returns
readonly Connection[]
createAccount()
createAccount(name, options?): Promise<void>;Defined in: packages/core/src/session/auth.ts:445
Makes an account. With username, it is claimed for the account in the
background while the rest of setup goes on, and username in the state
says how that went.
Parameters
| Parameter | Type |
|---|---|
name | string |
options? | { username?: string; } |
options.username? | string |
Returns
Promise<void>
disconnect()
disconnect(origin, options?): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:552
Disconnects an app: revokes its note in every space it could write in — and, for a whole-account app, in the account registry — so nothing it writes from now on counts, and forgets it. What this home had seen it write stays. What it could already read, it keeps — reading is holding a space's key, and that is not taken back.
Disconnecting by origin disconnects every connection made from it but a
carrier, which goes only by { audience }, its own key. Programs
connected by code are at the home's own origin; { audience }
disconnects one.
The app hears of it when the revokes reach it: from this node, or a
device that has them. { waitMs } waits up to that long for a peer to
take them in, and the answer says whether one did. False means they are
still only here: the app keeps working until this home is next online
with another of the account's devices or apps.
Parameters
| Parameter | Type |
|---|---|
origin | string |
options? | { audience?: string; waitMs?: number; } |
options.audience? | string |
options.waitMs? | number |
Returns
Promise<boolean>
dismissMoved()
dismissMoved(): void;Defined in: packages/core/src/session/auth.ts:482
Returns
void
dismissPairing()
dismissPairing(): void;Defined in: packages/core/src/session/auth.ts:460
Returns
void
finishSetup()
finishSetup(): void;Defined in: packages/core/src/session/auth.ts:449
Leaves the optional pod step with the data in this browser
Returns
void
forgetBrowserCopy()
forgetBrowserCopy(): Promise<void>;Defined in: packages/core/src/session/auth.ts:473
Removes the copy this browser kept after a move into a pod
Returns
Promise<void>
getState()
getState(): AuthState;Defined in: packages/core/src/session/auth.ts:409
Returns
grant()
grant(choice): Promise<Omit<Grant, "home">>;Defined in: packages/core/src/session/auth.ts:509
Gives an app access, as the account home: makes any spaces it asked for, signs a note from the account to the app's key for these spaces, and remembers the app as connected. The seed signs here and goes nowhere.
Parameters
| Parameter | Type |
|---|---|
choice | GrantChoice |
Returns
Promise<Omit<Grant, "home">>
grantCarry()
grantCarry(choice): Promise<Omit<CarryGrant, "home">>;Defined in: packages/core/src/session/auth.ts:515
Starts using a carrier, as the account home: makes its carry space, fills it with a pass for every space, and remembers it as connected. The carrier gets no key that reads or writes a space.
Parameters
| Parameter | Type |
|---|---|
choice | { origin: string; request: ConnectRequest; } |
choice.origin | string |
choice.request | ConnectRequest |
Returns
Promise<Omit<CarryGrant, "home">>
isConfirmed()
isConfirmed(): boolean;Defined in: packages/core/src/session/auth.ts:494
Whether confirm succeeded in the last few minutes
Returns
boolean
mayGrant()
mayGrant(): boolean;Defined in: packages/core/src/session/auth.ts:499
Whether grant and grantCarry may run now: isConfirmed, or a sign-in
with a password, passkey or the recovery code in the last few minutes.
Returns
boolean
offerToPhone()
offerToPhone(onStage): Promise<PairingOffer>;Defined in: packages/core/src/session/auth.ts:503
Starts offering this account to a phone
Parameters
| Parameter | Type |
|---|---|
onStage | (stage) => void |
Returns
Promise<PairingOffer>
propose()
propose(choice): Promise<Proposed>;Defined in: packages/core/src/session/auth.ts:525
Adds the subscriptions an app connected from this home proposed, as the account home — the ones the person kept, naming it, looking only at spaces it may reach.
Parameters
| Parameter | Type |
|---|---|
choice | ProposeChoice |
Returns
Promise<Proposed>
Throws
When no app from origin is connected here (a carrier or a program connected by code doesn't count), or a proposal names a space it wasn't given
recoveryCode()
recoveryCode(): string | null;Defined in: packages/core/src/session/auth.ts:501
The recovery code of the open account, for a few minutes after confirm. Null otherwise.
Returns
string | null
removeAccount()
removeAccount(): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:481
Removes the open account from this browser, after confirm and once no
app is connected from here: signs out, then deletes the account and its
spaces' data from this browser, as clearing its site data would. Copies elsewhere, on
other devices, carriers or hosts, stay; without one, its private spaces
are gone. Not for an account kept in a folder: that folder is its copy.
Returns
Promise<boolean>
removeShortcut()
removeShortcut(kind): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:469
Parameters
| Parameter | Type |
|---|---|
kind | "passphrase" | "passkey" |
Returns
Promise<boolean>
rename()
rename(name): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:464
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
Promise<boolean>
reopenPod()
reopenPod(): Promise<void>;Defined in: packages/core/src/session/auth.ts:417
Opens again the pod named in podToReopen, signed in if it was kept so. Needs a click.
Returns
Promise<void>
select()
select(accountId): Promise<void>;Defined in: packages/core/src/session/auth.ts:424
Parameters
| Parameter | Type |
|---|---|
accountId | string |
Returns
Promise<void>
setPassword()
setPassword(password): Promise<boolean>;Defined in: packages/core/src/session/auth.ts:468
Sets or replaces the account's password. During setup, moves the flow on; otherwise needs confirm first.
Parameters
| Parameter | Type |
|---|---|
password | string |
Returns
Promise<boolean>
settled()
settled(): Promise<void>;Defined in: packages/core/src/session/auth.ts:451
Resolves once the work setup began in the background is done: the username's claim, the host's handover
Returns
Promise<void>
showExisting()
showExisting(): void;Defined in: packages/core/src/session/auth.ts:435
"I already have an account": the ways to reach one from here
Returns
void
showRestore()
showRestore(): void;Defined in: packages/core/src/session/auth.ts:437
The recovery code form, for the selected account if there is one
Returns
void
showSignIn()
showSignIn(): void;Defined in: packages/core/src/session/auth.ts:431
Returns
void
showWelcome()
showWelcome(): void;Defined in: packages/core/src/session/auth.ts:433
Back to "new here, or not?"
Returns
void
signInWithCode()
signInWithCode(code): Promise<void>;Defined in: packages/core/src/session/auth.ts:426
Opens an account with its recovery code. Where it has no passkey or password yet, sets one up next.
Parameters
| Parameter | Type |
|---|---|
code | string |
Returns
Promise<void>
signInWithPasskey()
signInWithPasskey(): Promise<void>;Defined in: packages/core/src/session/auth.ts:429
Returns
Promise<void>
signInWithPassword()
signInWithPassword(password): Promise<void>;Defined in: packages/core/src/session/auth.ts:428
Opens the selected account with its password. A recovery code typed or filled here works too.
Parameters
| Parameter | Type |
|---|---|
password | string |
Returns
Promise<void>
signOut()
signOut(options?): Promise<void>;Defined in: packages/core/src/session/auth.ts:570
Signs this home out on this device: it forgets the unlocked account, lets
apps whose time has passed go, and revokes its own session key. The apps
connected from here keep their notes until they run out, as apps stay
signed in when you sign out of where you signed in to them.
{ disconnect: true } disconnects them first, and the programs connected
through them: their keys are revoked, and each sees it and asks to connect
again. Carriers stay: they hold nothing that writes.
Parameters
| Parameter | Type |
|---|---|
options? | { disconnect?: boolean; } |
options.disconnect? | boolean |
Returns
Promise<void>
start()
start(): Promise<void>;Defined in: packages/core/src/session/auth.ts:413
Looks for accounts and resumes a kept sign-in. Safe to call more than once.
Returns
Promise<void>
startCreating()
startCreating(): void;Defined in: packages/core/src/session/auth.ts:430
Returns
void
subscribe()
subscribe(listener): () => void;Defined in: packages/core/src/session/auth.ts:411
Called after every change. Returns a function that stops it.
Parameters
| Parameter | Type |
|---|---|
listener | (state) => void |
Returns
() => void
useBrowser()
useBrowser(): Promise<void>;Defined in: packages/core/src/session/auth.ts:421
Keeps accounts in this browser, and stops using a pod if one was open
Returns
Promise<void>