This commit is contained in:
seb
2026-10-29 16:27:02 +01:00
parent 005b48ff66
commit 676a40d4fe
6 changed files with 50 additions and 16 deletions

View File

@@ -1,5 +1,16 @@
import env from '../../config/env.js';
import { getSchemaVersion } from '../../db/store.js';
export function respondWithAuthenticatedUser(res, status, body) {
return res.status(status).json({ ...body, googleClientId: env.googleClientId });
export async function respondWithAuthenticatedUser(res, status, body) {
let schemaVersion = null;
try {
schemaVersion = await getSchemaVersion();
} catch {
// ignore if database not accessible
}
return res.status(status).json({
...body,
googleClientId: env.googleClientId,
schemaVersion,
});
}