minca
ApiSessionInterfaces

Interface: MincaAuth

Defined in: packages/core/src/session/auth.ts:403

Properties

PropertyModifierTypeDescriptionDefined in
staySignedInreadonlyobject-packages/core/src/session/auth.ts:551
staySignedIn.choicepublic() => StaySignedIn-packages/core/src/session/auth.ts:552
staySignedIn.setChoicepublic(choice) => Promise<void>-packages/core/src/session/auth.ts:553
staySignedIn.untilpublic() => Date | null-packages/core/src/session/auth.ts:554
usernamesreadonlystring | nullWhere new accounts take usernames (usernames in the config); null when none are offeredpackages/core/src/session/auth.ts:434

Methods

acceptPairing()

acceptPairing(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:452

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:461

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:454

Takes the account a pairing brought (added, or switched to if already here), or lets it go

Parameters

ParameterType
takeboolean

Returns

Promise<void>


cancelPod()

cancelPod(): void;

Defined in: packages/core/src/session/auth.ts:466

Returns

void


choosePod()

choosePod(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:414

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:456

Returns

void


codeSaved()

codeSaved(): void;

Defined in: packages/core/src/session/auth.ts:442

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:485

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

ParameterType
proof| { password: string; } | { passkey: true; } | { code: string; }

Returns

Promise<boolean>


confirmPod()

confirmPod(how): Promise<void>;

Defined in: packages/core/src/session/auth.ts:465

Parameters

ParameterType
how"combine" | "switch"

Returns

Promise<void>


connectedElsewhere()

connectedElsewhere(origin): readonly object[];

Defined in: packages/core/src/session/auth.ts:528

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

ParameterType
originstring

Returns

readonly object[]


connections()

connections(): readonly Connection[];

Defined in: packages/core/src/session/auth.ts:522

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:440

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

ParameterType
namestring
options?{ username?: string; }
options.username?string

Returns

Promise<void>


disconnect()

disconnect(origin, options?): Promise<boolean>;

Defined in: packages/core/src/session/auth.ts:547

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

ParameterType
originstring
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:477

Returns

void


dismissPairing()

dismissPairing(): void;

Defined in: packages/core/src/session/auth.ts:455

Returns

void


finishSetup()

finishSetup(): void;

Defined in: packages/core/src/session/auth.ts:444

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:468

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:404

Returns

AuthState


grant()

grant(choice): Promise<Omit<Grant, "home">>;

Defined in: packages/core/src/session/auth.ts:504

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

ParameterType
choiceGrantChoice

Returns

Promise<Omit<Grant, "home">>


grantCarry()

grantCarry(choice): Promise<Omit<CarryGrant, "home">>;

Defined in: packages/core/src/session/auth.ts:510

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

ParameterType
choice{ origin: string; request: ConnectRequest; }
choice.originstring
choice.requestConnectRequest

Returns

Promise<Omit<CarryGrant, "home">>


isConfirmed()

isConfirmed(): boolean;

Defined in: packages/core/src/session/auth.ts:489

Whether confirm succeeded in the last few minutes

Returns

boolean


mayGrant()

mayGrant(): boolean;

Defined in: packages/core/src/session/auth.ts:494

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:498

Starts offering this account to a phone

Parameters

ParameterType
onStage(stage) => void

Returns

Promise<PairingOffer>


propose()

propose(choice): Promise<Proposed>;

Defined in: packages/core/src/session/auth.ts:520

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

ParameterType
choiceProposeChoice

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:496

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:476

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:464

Parameters

ParameterType
kind"passphrase" | "passkey"

Returns

Promise<boolean>


rename()

rename(name): Promise<boolean>;

Defined in: packages/core/src/session/auth.ts:459

Parameters

ParameterType
namestring

Returns

Promise<boolean>


reopenPod()

reopenPod(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:412

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:419

Parameters

ParameterType
accountIdstring

Returns

Promise<void>


setPassword()

setPassword(password): Promise<boolean>;

Defined in: packages/core/src/session/auth.ts:463

Sets or replaces the account's password. During setup, moves the flow on; otherwise needs confirm first.

Parameters

ParameterType
passwordstring

Returns

Promise<boolean>


settled()

settled(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:446

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:430

"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:432

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:426

Returns

void


showWelcome()

showWelcome(): void;

Defined in: packages/core/src/session/auth.ts:428

Back to "new here, or not?"

Returns

void


signInWithCode()

signInWithCode(code): Promise<void>;

Defined in: packages/core/src/session/auth.ts:421

Opens an account with its recovery code. Where it has no passkey or password yet, sets one up next.

Parameters

ParameterType
codestring

Returns

Promise<void>


signInWithPasskey()

signInWithPasskey(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:424

Returns

Promise<void>


signInWithPassword()

signInWithPassword(password): Promise<void>;

Defined in: packages/core/src/session/auth.ts:423

Opens the selected account with its password. A recovery code typed or filled here works too.

Parameters

ParameterType
passwordstring

Returns

Promise<void>


signOut()

signOut(options?): Promise<void>;

Defined in: packages/core/src/session/auth.ts:565

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

ParameterType
options?{ disconnect?: boolean; }
options.disconnect?boolean

Returns

Promise<void>


start()

start(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:408

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:425

Returns

void


subscribe()

subscribe(listener): () => void;

Defined in: packages/core/src/session/auth.ts:406

Called after every change. Returns a function that stops it.

Parameters

ParameterType
listener(state) => void

Returns

() => void


useBrowser()

useBrowser(): Promise<void>;

Defined in: packages/core/src/session/auth.ts:416

Keeps accounts in this browser, and stops using a pod if one was open

Returns

Promise<void>

On this page