feat: capture and log browser information during user login

- Integrated browser information capture in the login process, including user agent and IP address.
- Enhanced device and browser detection logic to provide more detailed insights into user environments.
- Improved system detection for various operating systems and devices, ensuring accurate reporting during authentication.
This commit is contained in:
2025-11-04 02:27:56 -03:00
parent 372b2b5bf9
commit f278ad4d17
3 changed files with 272 additions and 12 deletions

View File

@@ -10,6 +10,7 @@
import NotificationBell from "$lib/components/chat/NotificationBell.svelte";
import ChatWidget from "$lib/components/chat/ChatWidget.svelte";
import PresenceManager from "$lib/components/chat/PresenceManager.svelte";
import { getBrowserInfo } from "$lib/utils/browserInfo";
let { children }: { children: Snippet } = $props();
@@ -100,9 +101,14 @@
carregandoLogin = true;
try {
// Capturar informações do navegador
const browserInfo = await getBrowserInfo();
const resultado = await convex.mutation(api.autenticacao.login, {
matriculaOuEmail: matricula.trim(),
senha: senha,
userAgent: browserInfo.userAgent || undefined,
ipAddress: browserInfo.ipAddress,
});
if (resultado.sucesso) {