igpapi — Instagram private API Simulator for Node.js (API reference) 4.19.0
    Preparing search index...

    Variable LoginTwoFactorAuthenticationAppCodeScreenConst

    LoginTwoFactorAuthenticationAppCodeScreen: ScreenDefinition<
        "LoginTwoFactorEnterTotpCode",
        "screen",
        { ticket: string & Brand<"TwoFactorPickerTicket"> },
        { ticket: string & Brand<"TwoFactorCodeTicket"> },
        LoginTwoFactorAuthenticationAppCodeState,
        BloksHttpError | TwoFactorBloksIssuedIdMissingError,

            | MobileDevice
            | MobileApplication
            | BloksHttp
            | MobileDisplayScaleWire
            | MobileNavigation
            | TwoFactorTickets,
        LoginTwoFactorAuthenticationAppCodeActions,
        Record<never, never>,
        never,
        never,
    > = ...

    com.bloks.www.two_factor_login.enter_totp_code, the authenticator-app code entry of the two-factor login (Android, opened in the CDS container).

    It is reached from LoginTwoFactorChooseMethodScreen.chooseAuthenticationApp() after the person picks "Authentication app". What the person sees, as the Android 448 app's login flow carries it: "Go to your authentication app", the six-digit code fields with the clear-code affordance ("Clear Code text"), the account row (" • Instagram"), a "Trust this device and skip this step from now on" toggle and a "Try another way" link. The toggle is the trustThisDevice option of submitCode(code, { trustThisDevice }) — on by default, as the app has it: the 451 recording's verify_code (030) sends should_trust_device: 1, while its polls send 0.

    Its enter is the app's pair: the method selection (method_picker.navigation.async, selected_method: totp, with the picker's selection QPL) and then this screen's own fetch with the code-entry screen instance the selection answer issued. The screen opens between the two calls, exactly as the app reports it: the selection request still reports the picker and the fetch reports the code screen. The fetch's answer issues the verify_code QPL and the poll QPL the screen keeps running behind it; both stay behind the screen's opaque ticket.

    Its actions:

    • checkApproval() polls has_been_allowed once with the poll QPL this screen's own answer issued and should_trust_device: 0, and returns { status: 'still-waiting' } while the login is not approved yet (the caller decides the pace; the library never polls on its own). An approved answer has already created the session; the action continues the process — the platform's launch sends the post-login burst and shows the feed, whose handle it returns. The traffic after a 2FA approval is not known: the action sends the same post-login burst the password login sends, and the app's own traffic would settle it. A declined answer is LoginTwoFactorApprovalDeclinedError, carrying the poll's answer; an answer that issued no poll QPL is TwoFactorBloksIssuedIdMissingError.
    • submitCode(code, { trustThisDevice }) sends verify_code with challenge: totp, no masked contact point, should_trust_device: 1 by default (false sends 0; the app's own default is 1 — the 451 recording's 030 sends it), the session's x-mid as machine_id and the screen's verify_code QPL. An accepted code embeds the login and its session headers; the action then continues the process — the platform's launch sends the post-login burst and shows the feed, whose handle it returns, as the 451 recording carries it from 030 to the feed. A rejected code fails with LoginTwoFactorAuthenticationAppCodeRejectedError, carrying the brick's TwoFactorBloksInvalidCodeError; an answer that is neither an accepted login nor the rejection marker is TwoFactorBloksLoginResponseNotFoundError.

    Only the authenticator-app branch is modelled: WhatsApp, SMS and backup codes are not modelled.

    Ships without a screenshot: producing a frame needs another account state we do not hold.

    Guide: Two-factor login