mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
moved jsconfig code into initScript
This commit is contained in:
@@ -2,9 +2,19 @@ const config = require('./config');
|
||||
const layout = require('./layout');
|
||||
const assets = require('../common/assets');
|
||||
const getTranslator = require('./locale');
|
||||
const { getFxaConfig } = require('./fxa');
|
||||
|
||||
module.exports = function(req) {
|
||||
module.exports = async function(req) {
|
||||
const locale = req.language || 'en-US';
|
||||
let authConfig = null;
|
||||
if (config.fxa_client_id) {
|
||||
try {
|
||||
authConfig = await getFxaConfig();
|
||||
authConfig.client_id = config.fxa_client_id;
|
||||
} catch (e) {
|
||||
// continue without accounts
|
||||
}
|
||||
}
|
||||
return {
|
||||
locale,
|
||||
capabilities: { account: false },
|
||||
@@ -21,6 +31,7 @@ module.exports = function(req) {
|
||||
fileInfo: {},
|
||||
cspNonce: req.cspNonce,
|
||||
user: { avatar: assets.get('user.svg'), loggedIn: false },
|
||||
authConfig,
|
||||
layout
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user