Files
dashback/src/api/auth/meJson.js
2026-10-30 16:10:07 +01:00

19 lines
520 B
JavaScript

import env from '../../config/env.js';
import { getSchemaVersion } from '../../db/store.js';
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,
vhost: env.vhost,
vhostSettings: env.vhostSettings,
});
}