u
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user