mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-03-10 04:51:47 +00:00
refactor: remover código morto e exports não utilizados
Remove 6 componentes não utilizados (dashboard-grid, expenses/income by category widgets, installment analysis panels, fatura-warning-dialog). Remove funções/tipos não utilizados: successResult, generateApiToken, validateApiToken, getTodayUTC/Local, formatDateForDb, getDateInfo, calculatePercentage, roundToDecimals, safeParseInt/Float, isPeriodValid, getLastPeriods, normalizeWhitespace, formatCurrency wrapper, InboxItemInput, InboxBatchInput, ProcessInboxInput, DiscardInboxInput, LancamentosColumnId, 5 funções de anticipation-helpers. Redireciona imports de formatCurrency para lib/lancamentos/formatting-helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -144,14 +144,6 @@ export function generateTokenId(): string {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random API token with prefix
|
||||
*/
|
||||
export function generateApiToken(): string {
|
||||
const randomPart = crypto.randomBytes(32).toString("base64url");
|
||||
return `os_${randomPart}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash a token using SHA-256
|
||||
*/
|
||||
@@ -236,18 +228,6 @@ export function extractBearerToken(authHeader: string | null): string | null {
|
||||
return match ? match[1] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate an API token and return the payload
|
||||
* @deprecated Use validateHashToken for os_xxx tokens
|
||||
*/
|
||||
export function validateApiToken(token: string): JwtPayload | null {
|
||||
const payload = verifyJwt(token);
|
||||
if (!payload || payload.type !== "api_access") {
|
||||
return null;
|
||||
}
|
||||
return payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a hash-based API token (os_xxx format)
|
||||
* Returns the token hash for database lookup
|
||||
|
||||
Reference in New Issue
Block a user