IGPAPI
    Preparing search index...

    Function applyBloksLoginInfo

    • Complete a session from a parsed Bloks login_response literal.

      The whole answer is parsed and checked first — the profile and the embedded headers map (ig-set-* / x-ig-set-*: authorization, dsUserId, rur, www-claim, shbid, region hint, server-served password key) — and only then applied through the session header parser. A LoginBloksParseError therefore means the session was not changed. Ensures dsUserId is set from pk_id and moves the session into the authenticated zero-rating phase. The single application point of an accepted login answer: Login, the approved trusted-notification poll, TwoFactorBloksVerifyCode and the two recovery steps (recovery.bloks-submit-code, recovery.login-with-code).

      Parameters

      • loginInfo: Record<string, unknown>

      Returns Effect<
          {
              logged_in_user: {
                  full_name?: string
                  | null;
                  is_private?: boolean | null;
                  is_verified?: boolean | null;
                  pk: number;
                  pk_id: string;
                  profile_pic_url?: string | null;
                  username: string;
              };
              status?: string;
              trusted_device_nonce?: string;
          },
          LoginBloksParseError,
          MobileSession
          | SessionHeaderParser,
      >