feat(desktop): add Tauri updater (GitHub Releases), updater UI button, hide PowerShell windows; fix Windows inventory arrays and activation; improve metrics parsing; branding rename to Raven across app; avoid localhost fallback in auth-server; inject APP_URL/AUTH_URL in stack
This commit is contained in:
parent
eb5f39100f
commit
418599ef62
18 changed files with 127 additions and 34 deletions
|
|
@ -103,6 +103,15 @@ export async function POST(request: Request) {
|
|||
} catch (error) {
|
||||
console.error("[machines.register] Falha no provisionamento", error)
|
||||
const details = error instanceof Error ? error.message : String(error)
|
||||
return jsonWithCors({ error: "Falha ao provisionar máquina", details }, 500, request.headers.get("origin"), CORS_METHODS)
|
||||
const msg = details.toLowerCase()
|
||||
// Mapear alguns erros "esperados" para códigos adequados
|
||||
// - empresa inválida → 404
|
||||
// - segredo inválido → 401
|
||||
// - demais ConvexError → 400
|
||||
const isCompanyNotFound = msg.includes("empresa não encontrada")
|
||||
const isInvalidSecret = msg.includes("código de provisionamento inválido")
|
||||
const isConvexError = msg.includes("convexerror")
|
||||
const status = isCompanyNotFound ? 404 : isInvalidSecret ? 401 : isConvexError ? 400 : 500
|
||||
return jsonWithCors({ error: "Falha ao provisionar máquina", details }, status, request.headers.get("origin"), CORS_METHODS)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue