Commit Graph

5 Commits

Author SHA1 Message Date
Felipe Coutinho
2d62fd0302 fix(api): use hash-based token validation instead of JWT
Changed all API endpoints to validate os_xxx tokens via SHA-256 hash
lookup in the database instead of expecting JWT format.

This allows tokens generated in the settings page (Ajustes → Dispositivos)
to work correctly with the Android app.

- /api/auth/device/verify: validates os_xxx tokens via hash
- /api/inbox: uses hash-based auth
- /api/inbox/batch: uses hash-based auth
- No token expiration (tokens valid until revoked)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:14:54 +00:00
Felipe Coutinho
2532f2d6ad feat(auth): add API token authentication for OpenSheets Companion
- Implement JWT-based authentication system for device access
  - Access tokens (7 day expiry) and refresh tokens (90 day expiry)
  - HMAC-SHA256 signing with timing-safe comparison
  - Token hashing with SHA-256 for secure storage

- Add device authentication endpoints:
  - POST /api/auth/device/token - Login with email/password, get tokens
  - POST /api/auth/device/refresh - Refresh access token
  - POST /api/auth/device/verify - Verify token validity
  - GET /api/auth/device/tokens - List user's API tokens
  - DELETE /api/auth/device/tokens/[id] - Revoke specific token

- Track token usage (last used timestamp and IP)
2026-01-23 12:11:19 +00:00
Felipe Coutinho
e7cb9c9db1 chore: remover seções vazias de mudanças de código
Este commit remove seções vazias de mudanças de código do arquivo de
mudanças. Isso ajuda a manter o histórico de mudanças mais limpo e
organizado, facilitando a leitura e a compreensão das alterações
realizadas no projeto.
2025-12-16 23:20:47 +00:00
Felipe Coutinho
9c004ca879 feat: remover variável de ambiente NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED
Removida a variável de ambiente NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED do
arquivo .env.example e ajustada a lógica de verificação do login
com Google no cliente de autenticação. Agora, a disponibilidade
do login com Google sempre retorna true, e a validação real
deve ser feita no servidor. Também removido o script de lint
do package.json.
2025-11-16 00:54:04 -03:00
Felipe Coutinho
ea0b8618e0 feat: adição de novos ícones SVG e configuração do ambiente
- Adicionados ícones SVG para ChatGPT, Claude, Gemini e OpenRouter
- Implementados ícones para modos claro e escuro do ChatGPT
- Criado script de inicialização para PostgreSQL com extensão pgcrypto
- Adicionado script de configuração de ambiente que faz backup do .env
- Configurado tsconfig.json para TypeScript com opções de compilação
2025-11-15 15:49:36 -03:00