phalcon/cphalcon · error · InvalidClaims

Invalid Claims (not an array)

Error message

Invalid Claims (not an array)

What it means

Error "Invalid Claims (not an array)" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Encryption/Security/JWT/Token/Parser.zep:86

        return new Token(headers, claims, signature);
    }

    /**
     * Decode the claims
     *
     * @param string $claims
     *
     * @return Item
     */
    private function decodeClaims(string claims) -> <Item>
    {
        var decoded;

        let decoded = this->decode->__invoke(this->doDecodeUrl(claims), true);

        if typeof decoded !== "array" {
            throw new InvalidClaims();
        }

        /**
         * Just in case
         */
        if isset decoded[Enum::AUDIENCE] && typeof decoded[Enum::AUDIENCE] !== "array" {
            let decoded[Enum::AUDIENCE] = [decoded[Enum::AUDIENCE]];
        }

        return new Item(decoded, claims);
    }

    /**
     * Decodes the headers
     *
     * @param string $headers
     *
     * @return Item

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Encryption/Security/JWT/Token/Parser.zep:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/7f885c879bd54847. Report an issue: GitHub.