fix(api): wrap encryptSecret in try/catch to return proper JSON error
PUT /api/admin/auth-provider was returning HTTP 500 with an HTML error page when BETTER_AUTH_SECRET was missing, because encryptSecret() throws an unhandled error. This change wraps both the encryption step and the DB transaction in try/catch blocks to return a proper JSON error response. Also adds the missing authProviderConfig schema and encryptSecret crypto helpers from the feat/gro-392-oobe-auth-provider-bootstrap branch. Fixes: GRO-441 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -3,6 +3,7 @@ import postgres from "postgres";
|
||||
import * as schema from "./schema.js";
|
||||
|
||||
export * from "./schema.js";
|
||||
export { encryptSecret, decryptSecret } from "./crypto.js";
|
||||
export { and, asc, desc, eq, exists, gte, gt, ilike, inArray, lt, lte, ne, or, sql } from "drizzle-orm";
|
||||
export { encryptSecret, decryptSecret } from "./crypto.js";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user