Skip to content

chore: retire v1 account auth endpoints in favor of v2#322

Open
hhvrc wants to merge 2 commits into
developfrom
chore/retire-v1-auth-endpoints
Open

chore: retire v1 account auth endpoints in favor of v2#322
hhvrc wants to merge 2 commits into
developfrom
chore/retire-v1-auth-endpoints

Conversation

@hhvrc

@hhvrc hhvrc commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The v1 login, signup, and password-reset account endpoints predate Cloudflare Turnstile and accept captcha-less request bodies. Their v2 counterparts already require a turnstile token, so this PR retires the v1 routes.

Changes

  • Retire v1 routes with 410 GonePOST /1/account/login, /1/account/signup, and /1/account/reset now return a clear problem response (Endpoint.Retired) pointing at the v2 replacement instead of silently 404ing. They're also hidden from the OpenAPI document via [ApiExplorerSettings(IgnoreApi = true)].
  • Drop the captcha-less v1 request DTOs (Login, SignUp) and the now-unused CreateAccountWithoutActivationFlowLegacyAsync service method.
  • Consolidate Turnstile verification — the duplicated verification block in LoginV2, SignupV2, and PasswordResetInitiateV2 is now a single shared VerifyTurnstileAsync helper on AccountController.
  • Tests — migrate flows that previously used the v1 routes onto v2 (adding the turnstile token / usernameOrEmail field), preserve duplicate-username coverage, and add tests asserting each v1 endpoint responds 410 Gone.

Notes

  • CreateAccount's verifyOnCreation parameter is retained (defaulting to false).
  • 410 Gone was chosen over 404/400 because it semantically signals a permanently-removed resource.

Testing

AccountLoginTests (8), AccountSignupTests (7), RegistrationDisabledTests (1), and MailTests (15) all pass locally against the Docker test containers.


Open in Stage

The v1 login, signup, and password-reset endpoints predate Cloudflare
Turnstile and have captcha-less request bodies. Their v2 counterparts
(/2/account/login, /signup, /password-reset) require a turnstile token,
so the v1 routes are now retired.

- v1 POST /1/account/login, /signup, /reset now return 410 Gone with a
  problem response pointing at the v2 replacement, and are hidden from
  the OpenAPI document (ApiExplorerSettings.IgnoreApi).
- Remove the captcha-less v1 request DTOs (Login, SignUp) and the
  now-unused CreateAccountWithoutActivationFlowLegacyAsync service method.
- Extract the duplicated Turnstile verification block from LoginV2,
  SignupV2, and PasswordResetInitiateV2 into a shared
  VerifyTurnstileAsync helper.
- Migrate integration tests off the retired routes and add coverage
  asserting the v1 endpoints respond 410 Gone.
@stage-review

stage-review Bot commented Jun 24, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 5 individual chapters for you:

Title
1 Define GoneError for retired endpoints
2 Consolidate Turnstile verification logic
3 Retire v1 account endpoints
4 Remove legacy DTOs and service methods
5 Update integration tests for v2 migration
Open in Stage

Chapters generated by Stage for commit 3aea4bd on Jun 24, 2026 10:54am UTC.

The deprecated /reset-password and /recover password-reset aliases are
unused by the new frontend (verified: no call sites outside the
generated SDK), so retire them alongside the v1 auth endpoints.

- POST /2/account/reset-password, POST /1/account/recover/{id}/{secret},
  and HEAD /1/account/recover/{id}/{secret} now return 410 Gone pointing
  at their canonical replacements, and are hidden from the OpenAPI doc.
- Replace the "legacy route still works" tests with 410 Gone assertions
  and add coverage for the retired /reset-password alias.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant