veza/veza-backend-api/tests
senke 083b5718a7 feat(auth): defer JWT to post-verify + verify-email header (v1.0.9 items 1.3+1.4)
Item 1.4 — Register no longer issues an access+refresh token pair. The
prior flow set httpOnly cookies at register but the AuthMiddleware
refused them on every protected route until the user had verified
their email (`core/auth/service.go:527`). Users ended up with dead
credentials and a "logged in but locked out" UX. Register now returns
{user, verification_required: true, message} and the SPA's existing
"check your email" notice fires naturally.

Item 1.3 — `POST /auth/verify-email` reads the token from the
`X-Verify-Token` header in preference to the `?token=…` query param.
Query param logged a deprecation warning but stays accepted so emails
dispatched before this release still work. Headers don't leak through
proxy/CDN access logs that record URL but not headers.

Tests: 18 test files updated (sed `_, _, err :=` → `_, err :=` for the
new Register signature). `core/auth/handler_test.go` gets a
`registerVerifyLogin` helper for tests that exercise post-login flows
(refresh, logout). Two new E2E `@critical` specs lock in the defer-JWT
contract and the header read-path.

OpenAPI + orval regenerated to reflect the new RegisterResponse shape
and the verify-email header parameter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 22:56:31 +02:00
..
analytics refactor(backend): unify architecture - migrate analytics handler to core (ADR-001) 2026-02-15 16:18:13 +01:00
contract fix(hyperswitch): idempotency-key on create-payment and create-refund — v1.0.7 item D 2026-04-18 02:30:02 +02:00
error_handling [FE-PAGE-015] fe-page: Add Analytics page 2025-12-25 11:25:06 +01:00
filtering_sorting [FE-PAGE-015] fe-page: Add Analytics page 2025-12-25 11:25:06 +01:00
integration fix(hyperswitch): idempotency-key on create-payment and create-refund — v1.0.7 item D 2026-04-18 02:30:02 +02:00
load style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
marketplace style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
pagination [FE-PAGE-015] fe-page: Add Analytics page 2025-12-25 11:25:06 +01:00
performance style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
search [FE-PAGE-015] fe-page: Add Analytics page 2025-12-25 11:25:06 +01:00
security v0.9.1 2026-03-05 19:22:31 +01:00
transactions test(backend): gate testcontainers tests behind VEZA_SKIP_INTEGRATION 2026-04-14 11:45:19 +02:00
two_factor feat(auth): defer JWT to post-verify + verify-email header (v1.0.9 items 1.3+1.4) 2026-04-26 22:56:31 +02:00
webhook_delivery [FE-PAGE-015] fe-page: Add Analytics page 2025-12-25 11:25:06 +01:00
api_routes_integration_test.go fix(backend): pass METRICS_BEARER_TOKEN in TestPublicCoreRoutes 2026-04-14 11:44:53 +02:00
verify_auth.sh refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
verify_p0.sh refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
verify_timeout.sh refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00