19 lines
520 B
JavaScript
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,
|
|
});
|
|
}
|