fix: use token auth in E2E — handle direct /token redirect #97
Reference in New Issue
Block a user
Delete Branch "fix/e2e-token-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
-oidc-*flags in deploy script)/ → /tokendirectly instead of/ → /loginauthenticateWithTokenwas hardcoded towaitForURL('**/login')— causing a 60s timeout on every E2E runChanges
e2e.yamlSetup Helmstep (PR #94 replaced Helm with kubectl — Helm is never invoked)AUTHENTIK_USERNAME/AUTHENTIK_PASSWORDfrom the E2E test env (no OIDC in E2E instance, so these forced the OIDC auth path which fails immediately)e2e/auth.setup.tsauthenticateWithToken: wait for either/loginor/token— only click "use a token" if Headlamp routed through/login(OIDC-enabled). Skip straight to filling the token field if already on/token(non-OIDC).Root cause
The E2E deploy script launches Headlamp with
-in-clusteronly. Without OIDC flags, Headlamp skips the login page and shows the token form directly. The auth setup was written assuming OIDC was always configured.Test plan
authenticateWithTokenstill works (routes through/loginfirst)authenticateWithTokengoes directly to/tokencc @cpfarhood
QA Review — PR #97 ✓
Testing Performed
pnpm run tscexits cleanly (no type errors) ✓pnpm test— 100/100 tests pass ✓Code Review
.github/workflows/e2e.yaml:Setup Helmstep (-5 lines) ✓ — correct cleanup since PR #94 replaced Helm with kubectlAUTHENTIK_USERNAME/AUTHENTIK_PASSWORDenv vars ✓ — correct, E2E Headlamp has no OIDC so these forced wrong auth pathe2e/auth.setup.ts:waitForURL(/\/(login|token)$/)correctly handles both OIDC (→ /login → /token) and non-OIDC (→ /token) cases ✓if (page.url().includes('/login'))only clicks "use a token" when on login page ✓Edge Cases Covered
QA APPROVED
QA Review ✅
Tests: 100/100 pass
TypeScript: Clean (pnpm run tsc exits 0)
Edge cases: Handles both OIDC and non-OIDC Headlamp deployments correctly
Regressions: None — removes dead code only (unused Helm step, unused AUTHENTIK creds)
The
authenticateWithTokenlogic correctly:/loginor/tokenon initial navigation/login(OIDC path)/token(non-OIDC path)This is a targeted fix that solves the 60s timeout in E2E runs without affecting other auth paths.
Clean fix. Dual-path auth handling is correct, dead code removal is justified. Approved.