rueder frontend
    Preparing search index...

    Interface AccountSettings

    What an account sets about itself, with a server.

    interface AccountSettings {
        appsVersion: number;
        can: { email: boolean; passkeys: boolean };
        addPasskey(
            name: string,
            password: string,
            code: string,
            passkey?: PasskeyProof,
        ): Promise<AddedPasskey | PasskeyRefusal>;
        appPasswords(): Promise<AppPasswords | null>;
        changeEmail(
            address: string,
            password: string,
            code?: string,
            passkey?: PasskeyProof,
        ): Promise<EmailRefusal | null>;
        changePassword(
            current: string,
            fresh: string,
            code?: string,
            passkey?: PasskeyProof,
        ): Promise<PasswordRefusal | null>;
        confirmSecondFactor(code: string): Promise<string[] | SecondFactorRefusal>;
        createAppPassword(
            name: string,
            password: string,
            code: string,
            passkey?: PasskeyProof,
        ): Promise<NewAppPassword | AppPasswordRefusal>;
        invite(uses: number): Promise<{ link: string } | "none-left" | null>;
        invites(): Promise<Invites | null>;
        passkeys(): Promise<PasskeyList | null>;
        provePasskey(): Promise<PasskeyProof | PasskeyRefusal>;
        removeAccount(
            proof: string,
            code?: string,
            passkey?: PasskeyProof,
        ): Promise<RemoveRefusal | null>;
        removeEmail(
            password: string,
            code?: string,
            passkey?: PasskeyProof,
        ): Promise<EmailRefusal | null>;
        removePasskey(
            id: number,
            password: string,
            code: string,
            passkey?: PasskeyProof,
        ): Promise<PasskeyRefusal | null>;
        revokeAppPassword(id: number): Promise<boolean>;
        revokeInvite(id: number): Promise<boolean>;
        secondFactor(): Promise<SecondFactorState | null>;
        setUpSecondFactor(
            password: string,
            code?: string,
            passkey?: PasskeyProof,
        ): Promise<SecondFactorSetup | SecondFactorRefusal>;
        switchOffSecondFactor(
            password: string,
            code: string,
            passkey?: PasskeyProof,
        ): Promise<SecondFactorRefusal | null>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    appsVersion: number

    Counts up when app passwords change or an app logs in for the first time, in another tab or from the app itself.

    can: { email: boolean; passkeys: boolean }

    What the server has: addresses at all, and passkeys this browser can use too.

    • Mails a link to a new address for the account (can.email), with the password (none for an account that has none) and the code of its second factor where it has one, or a passkey's proof instead. The address counts once the link is opened; until then account.emailPending of the reader names it. Null when the link went.

      Parameters

      • address: string
      • password: string
      • Optionalcode: string
      • Optionalpasskey: PasskeyProof

      Returns Promise<EmailRefusal | null>

    • Gives the account another password, with the one so far; an account that logs in through single sign-on alone has none and sends nothing. Where the second factor is on, a code goes with it, or a passkey stands for both. Null when it worked: every other session of the account ends, this one goes on.

      Parameters

      • current: string
      • fresh: string
      • Optionalcode: string
      • Optionalpasskey: PasskeyProof

      Returns Promise<PasswordRefusal | null>

    • Makes an invitation for so many accounts. The link is shown once: nobody can ask for it again. none-left if the reader's invitations are used up, null if there was no answer.

      Parameters

      • uses: number

      Returns Promise<{ link: string } | "none-left" | null>

    • The reader's invitations and how many more they can make; null if there was no answer.

      Returns Promise<Invites | null>

    • Deletes the account for good, with the password, or the account's name where it has none, and the code of its second factor where it has one; or with a passkey's proof instead of all of that. Null when it is gone: then the page is logged out.

      Parameters

      • proof: string
      • Optionalcode: string
      • Optionalpasskey: PasskeyProof

      Returns Promise<RemoveRefusal | null>

    • Removes a passkey, with the same proof as adding one; null when it worked.

      Parameters

      • id: number
      • password: string
      • code: string
      • Optionalpasskey: PasskeyProof

      Returns Promise<PasskeyRefusal | null>

    • Takes an invitation back; false if that did not work.

      Parameters

      • id: number

      Returns Promise<boolean>

    • Switches the app off, with the account's password and a code of the app or a recovery code, or a passkey's proof; null when it worked.

      Parameters

      • password: string
      • code: string
      • Optionalpasskey: PasskeyProof

      Returns Promise<SecondFactorRefusal | null>