fix: resolve migration 032 column size, update credentials, silence auth logs
This commit is contained in:
parent
fbb218034e
commit
c8d4ff2726
3 changed files with 14 additions and 12 deletions
17
README.md
17
README.md
|
|
@ -240,16 +240,15 @@ cd seeder-api && npm install && npm run seed
|
|||
> O SuperAdmin foi atualizado via migration `032_update_superadmin_lol.sql`.
|
||||
> No primeiro login será necessário trocar a senha (status `force_change_password`).
|
||||
|
||||
| Tipo | Login | Email | Acesso |
|
||||
|------|-------|-------|--------|
|
||||
| **SuperAdmin** | `lol` | `lol@gohorsejobs.com` | Full |
|
||||
| **Company Admin** | `takeshi_yamamoto` | - | Empresa |
|
||||
| **Recruiter** | `maria_santos` | - | Vagas |
|
||||
| **Candidate** | `paulo_santos` | - | Candidato |
|
||||
| Tipo | Login | Email | Senha |
|
||||
|------|-------|-------|-------|
|
||||
| **SuperAdmin** | `lol` | `lol@gohorsejobs.com` | `Admin@2025!` |
|
||||
| **Company Admin** | `takeshi_yamamoto` | - | `Takeshi@2025` |
|
||||
| **Recruiter** | `maria_santos` | - | `User@2025` |
|
||||
| **Candidate** | `paulo_santos` | - | `User@2025` |
|
||||
|
||||
**Senhas padrão:**
|
||||
- SuperAdmin: *trocar no primeiro acesso*
|
||||
- Demais usuários: `User@2025` ou `Takeshi@2025`
|
||||
> [!WARNING]
|
||||
> Se o login retornar 401, verifique se a migration `032_update_superadmin_lol.sql` foi executada no banco.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
-- Migration: Update Super Admin to 'lol' and force password reset
|
||||
-- Description: Updates the superadmin identifier, email, name, and sets status to enforce password change.
|
||||
|
||||
-- Increase status column length to support 'force_change_password' (21 chars)
|
||||
ALTER TABLE users ALTER COLUMN status TYPE VARCHAR(50);
|
||||
|
||||
UPDATE users
|
||||
SET
|
||||
identifier = 'lol',
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ export function getCurrentUser(): User | null {
|
|||
console.log("%c[AUTH] User Loaded from Storage", "color: #10b981", user.email);
|
||||
return user;
|
||||
}
|
||||
// Only log warning in browser, not during SSR
|
||||
console.warn("%c[AUTH] No user found in storage", "color: #f59e0b");
|
||||
// User not in storage (normal state)
|
||||
console.log("%c[AUTH] No user session found", "color: #94a3b8");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ export async function refreshSession(): Promise<User | null> {
|
|||
|
||||
if (!res.ok) {
|
||||
// Cookie expired or invalid - clear local storage
|
||||
console.warn("%c[AUTH] Session refresh failed:", "color: #f59e0b", res.status);
|
||||
console.log("%c[AUTH] Session refresh: No session", "color: #94a3b8", res.status);
|
||||
localStorage.removeItem(AUTH_KEY);
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue