refactor: remove unused authentication files and dependencies; update package.json to streamline dependencies and improve project structure

This commit is contained in:
2025-10-29 18:57:05 -03:00
parent f219340cd8
commit 1058375a90
29 changed files with 1426 additions and 1542 deletions

View File

@@ -6,7 +6,7 @@ import { Doc, Id } from "./_generated/dataModel";
* Helper para registrar tentativas de login
*/
export async function registrarLogin(
ctx: QueryCtx | MutationCtx,
ctx: MutationCtx,
dados: {
usuarioId?: Id<"usuarios">;
matriculaOuEmail: string;
@@ -170,26 +170,32 @@ export const obterEstatisticasLogin = query({
// Logins por horário (hora do dia)
const porHorario: Record<number, number> = {};
logs.filter((l) => l.sucesso).forEach((log) => {
const hora = new Date(log.timestamp).getHours();
porHorario[hora] = (porHorario[hora] || 0) + 1;
});
logs
.filter((l) => l.sucesso)
.forEach((log) => {
const hora = new Date(log.timestamp).getHours();
porHorario[hora] = (porHorario[hora] || 0) + 1;
});
// Browser mais usado
const porBrowser: Record<string, number> = {};
logs.filter((l) => l.sucesso).forEach((log) => {
if (log.browser) {
porBrowser[log.browser] = (porBrowser[log.browser] || 0) + 1;
}
});
logs
.filter((l) => l.sucesso)
.forEach((log) => {
if (log.browser) {
porBrowser[log.browser] = (porBrowser[log.browser] || 0) + 1;
}
});
// Dispositivos mais usados
const porDevice: Record<string, number> = {};
logs.filter((l) => l.sucesso).forEach((log) => {
if (log.device) {
porDevice[log.device] = (porDevice[log.device] || 0) + 1;
}
});
logs
.filter((l) => l.sucesso)
.forEach((log) => {
if (log.device) {
porDevice[log.device] = (porDevice[log.device] || 0) + 1;
}
});
return {
total: logs.length,
@@ -231,4 +237,3 @@ export const verificarIPSuspeito = query({
};
},
});