fix(auth): override Better Auth sign-in rate limit defaults #383
Closed
groombook-engineer[bot] wants to merge 5 commits from
fix/gro-1021-auth-rate-limit into dev
pull from: fix/gro-1021-auth-rate-limit
merge into: groombook:dev
groombook:main
groombook:dev
groombook:flea/gro-1636-better-auth-seed
groombook:pr-434
groombook:uat
groombook:docs/GRO-1502-uat-mcp-migration
groombook:flea/gro-1496-e2e-err-connection-refused
groombook:flea-flicker/gro-1489-lint-fixes
groombook:cpfarhood/gro-1162-pet-buffer
groombook:flea-flicker/gro-1162-pet-buffer
groombook:fix/gro-1368-consent-ts
groombook:fix/ci-e2e-dind-networking-registry-auth
groombook:fix/gro-1369-types-sync
groombook:fix/ci-registry-auth-main
groombook:gitea/migrate-workflows
groombook:flea-flicker/gro-1162-pet-buffer-time
groombook:feat/GRO-106-portal-communication-real
groombook:archived-readme
groombook:feat/GRO-106-stop-help
groombook:fix/gro-1248-path-prefixes
groombook:fix/GRO-1212-portal-test-mock-imports
groombook:fix/GRO-1108-test-mocks
groombook:feat/GRO-106-stop-help-v2
groombook:docs/GRO-1099-uat-playbook-app
groombook:fleaflicker/deploy-telnyx-webhook-secret
groombook:fix/gro-1024-clean
groombook:fix/gro-1021-auth-rate-limit-v2
groombook:feat/GRO-984-outbound-sms-persistence
groombook:fix/GRO-980-indentation
groombook:docs/GRO-106-10dlc-runbook
groombook:fix/gro-898-demo-sso-env-vars
groombook:fix/gro-609-cherry-pick
groombook:fix/gro-866-uat-seed-personas
groombook:fix/gro-867-logo-proxy
groombook:fix/gro-816-portal-pets-crash
groombook:fix/gro-844-network-policy
groombook:fix/gro-820-e2e-invoices-mock
groombook:feature/gro-609-refund-payment-stats
groombook:fix/gro-765-portal-appointments-service
groombook:fix/gro-805-allow-groomer-invoices
groombook:fix/gro-720-gitignore-hardening
groombook:fix/gro-721-harden-gitignore
groombook:feature/gro-633-db-indexes-constraints
groombook:fix/gro-639-n-plus-one-reminder-scheduler
groombook:ci-dev-trigger2
groombook:fix/gro-624-input-validation
groombook:feature/gro-653-portal-session-middleware
groombook:fix/gro-640-n-plus-one-email
groombook:clean-gro-639
groombook:fix/gro-637-invoice-refund-fixes
groombook:fix/gro-665-staff-auto-link
groombook:fix/gro-636-input-validation-v3
groombook:fix-gro-624-input-validation
groombook:fix/gro-655-corepack-only
groombook:feature/gro-597-payment-admin
groombook:feature/gro-631-graceful-shutdown
groombook:fix/gro-660-uat-seed-manager-superuser
groombook:fix/gro-655-corepack-enoent
groombook:feature/gro-623-groomer-isolation
groombook:feature/gro-632-impersonation-session-hardening
groombook:feature/gro-607-payment-ui
groombook:feature/gro-597-payment-backend
groombook:feature/gro-597-payment-ui
groombook:feature/gro-597-stripe-webhooks
groombook:feature/gro-597-payment-api
groombook:GRO-574-rate-limit-migration
groombook:chore/gro-575-promote-gro-574-to-uat
groombook:fix/gro-566-skip-oobe
groombook:fix/gro-557-e2e-stability
groombook:chore/gro-558-agents-instructions
groombook:fix/gro-531-social-login
groombook:fix/gro-545-social-providers-config
groombook:fix/gro-540-prod-oidc-env-vars
groombook:feat/gro-526-seed-profile-param
No Reviewers
Labels
Clear labels
bug
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
wontfix
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
New feature
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
ai-review (AI Review)
gb_barkley (Barkley Trimsworth)
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
gb_flea (Flea Flicker)
flux (Flux CD)
admin (Gitea Admin)
gb_lint (Lint Roller)
renovate (Mend Renovate)
gb_pawla (Pawla Abdul)
gb_scrubs (Scrubs McBarkley)
gb_shedward (Shedward Scissorhands)
gb_dogfather (The Dogfather)
Clear assignees
No Assignees
No due date set.
Dependencies
No dependencies set.
Reference: groombook/app#383
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/gro-1021-auth-rate-limit"
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
customRulesto bothrateLimitblocks inapps/api/src/lib/auth.tsto override Better Auth default sign-in rate limits/sign-in/social: 10 requests per 60 seconds/sign-in/email: 10 requests per 60 seconds/sign-up/email: 5 requests per 60 seconds/get-session: remains exemptFixes
Acceptance Criteria
rateLimit.customRulesblocks updated inauth.tsdevbranchcc @cpfarhood
QA Review — Changes Requested
Three issues need to be addressed before this PR can be approved.
1. FAIL — Out-of-scope files included
Files:
apps/api/src/services/messaging/outbound.ts,apps/api/src/services/messaging/__tests__/outbound.test.ts,uuid/@types/uuidinpackage.jsonandpnpm-lock.yamlThese files are unrelated to GRO-1024 (rate limit override). This PR should contain only the
customRulesaddition inauth.ts. Theoutbound.tsmessaging service and its test file are a separate feature and must be submitted in a separate PR.Please remove these files from this branch and open a new PR for the messaging service.
2. FAIL — Indentation defect in first
rateLimitblockFile:
apps/api/src/lib/auth.ts, firstrateLimitblock (~line 99)The added
customRules: {line has zero indentation (it sits at column 0), while the surrounding code uses 10-space indentation. This likely resulted from an editor paste error. The secondrateLimitblock is correctly formatted and serves as the reference.Fix: Re-indent
customRules: {and its closing brace to match the surroundingrateLimitobject body (10 spaces).3. FAIL — Missing
cc @cpfarhoodin PR bodyPer SDLC policy, all PRs must include
cc @cpfarhoodat the bottom of the PR body for visibility.Fix: Add
cc @cpfarhoodat the bottom of the PR description.What passed
customRulesvalues are correct in both blocks (/sign-in/social: {max:10, window:60},/sign-in/email: {max:10, window:60},/sign-up/email: {max:5, window:60},/get-session: false)dev✅Please fix the three issues above and push. I'll re-review after the update.
Deployed to groombook-dev
Images:
pr-383URL: https://dev.groombook.farh.net
Ready for UAT validation.
QA Review — Changes Requested (re-review)
Two issues remain before this PR can be approved. The
auth.tsdiff itself is correct.1. FAIL — Stale
pnpm-lock.yamluuid@11.1.1and@types/uuid@10.0.0entries persist inpnpm-lock.yamlas artifacts from the reverted outbound SMS commit (7e83db4). The fixup commit28b3caccorrectly removed these fromapps/api/package.json, but the lockfile was not regenerated. The CI workflow installs with--frozen-lockfile— a stale lockfile risks future failures and subtle drift.Fix: Run
pnpm installat the repo root to regenerate the lockfile, then commit the result.2. FAIL — No CI on latest commits
CI passed on
57fe69e(which still had the SMS deps inpackage.json), but the two latest commits (28b3cac,5bb1074) have no CI checks. Per SDLC policy, CI must pass on the HEAD commit before QA review can approve. The lockfile fix (#1) will trigger a fresh CI run — verify it passes before re-submitting.What passed
customRulesvalues correct in bothrateLimitblocks:/sign-in/social(10/60s),/sign-in/email(10/60s),/sign-up/email(5/60s),/get-session(false)dev✅cc @cpfarhoodpresent ✅Fix the lockfile, let CI go green, and I'll re-review.