Skip to content

CI: e2e auth full failing: jose generateJWT 'payload must be an instance of Uint8Array' (jwt.ts:66) #5092

Open

Description

@fitzyracing1

What fails

Workflow .github/workflows/e2e-webapp-auth-full.yml fails on main in job 🛡️ E2E Auth Tests (full).

Error

FAIL test/emailChangeConfirmation.e2e.full.test.ts > redirects off the token URL and confirms only when the rendered form is submitted
TypeError: payload must be an instance of Uint8Array
 ❯ new FlattenedSign node_modules/.pnpm/jose@5.4.0/node_modules/jose/dist/node/esm/jws/flattened/sign.js:14:19
 ❯ new CompactSign node_modules/.pnpm/jose@5.4.0/node_modules/jose/dist/node/esm/jws/compact/sign.js:5:27
 ❯ SignJWT.sign node_modules/.pnpm/jose@5.4.0/node_modules/jose/dist/node/esm/jwt/sign.js:12:21
FAIL test/auth-api.e2e.full.test.ts > API > Query dashboards — GET /api/v1/query/dashboards (sanity) > JWT read:query: auth passes
AssertionError: expected 403 not to be 403
 Test Files  2 failed | 7 passed (9)
      Tests  4 failed | 254 passed (258)

When it started

Likely cause

jose@5.4.0 receives a non-Uint8Array (cross-realm/TextEncoder) secret in the test env.

Suggested fix

Pass the secret via new TextEncoder().encode in the same realm, or bump jose.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions