Skip to content

fix(auth): endurece login social e OTP (auditoria COMP-001, 002, 005, 010) - #54

Merged
vinicius3w merged 1 commit into
developfrom
fix/auth-hardening
Oct 9, 2026
Merged

vinicius3w merged 1 commit into
developfrom
fix/auth-hardening

Conversation

@vinicius3w

Copy link
Copy Markdown
Contributor

Auditoria de segurança 2026-10. Bloqueia criação de usuário social com e-mail não verificado (a correção só com requireEmailVerification não bastava: o Better Auth cria usuário e conta antes de checar), limita códigos por e-mail (5/h, 20/dia), guarda OTP com hash e restringe o vínculo por e-mail a linhas sem auth_id. Sem migração.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VDxbrneS3TEAUmdgVmkKpQ

… 010)

- bloqueia criacao de usuario cujo e-mail o provedor nao verificou (hook de criacao + requireEmailVerification) e exige e-mail verificado ao aceitar convite
- limite de codigos por e-mail (5/h, 20/dia), em auth_rate_limit com upsert atomico, antes de gerar o codigo
- OTP guardado com hash (storeOTP hashed)
- vinculo por e-mail em ensureUser so para linhas sem auth_id

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDxbrneS3TEAUmdgVmkKpQ
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
compasso Ready Ready Preview Oct 9, 2026 10:15pm UTC

@vinicius3w
vinicius3w merged commit 1d12855 into develop Oct 9, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7627e94a Deployed Oct 9, 2026 by vercel[bot]
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