refactor: remove authentication module and integrate Better Auth

- Deleted the `autenticacao.ts` file to streamline the authentication process.
- Updated the `auth.ts` file to include new functions for user management and password updates.
- Modified the schema to enforce the presence of `authId` for users, ensuring integration with Better Auth.
- Refactored the seed process to create users with Better Auth integration, enhancing user management capabilities.
- Cleaned up the `usuarios.ts` file to utilize the new authentication functions and improve code clarity.
This commit is contained in:
2025-11-07 23:33:09 -03:00
parent 427c78ec37
commit 3a32f5e4eb
6 changed files with 377 additions and 1350 deletions

View File

@@ -381,8 +381,7 @@ export default defineSchema({
// Sistema de Autenticação e Controle de Acesso
usuarios: defineTable({
authId: v.optional(v.string()),
senhaHash: v.string(), // Senha criptografada com bcrypt
authId: v.string(),
nome: v.string(),
email: v.string(),
funcionarioId: v.optional(v.id("funcionarios")),