forked from mirrors/amnezia-wg-easy
hotfix: load language before session is initialized (#778)
This commit is contained in:
commit
3ae9072686
2 changed files with 11 additions and 10 deletions
|
@ -41,6 +41,10 @@ module.exports = class Server {
|
||||||
return RELEASE;
|
return RELEASE;
|
||||||
})))
|
})))
|
||||||
|
|
||||||
|
.get('/api/lang', (Util.promisify(async () => {
|
||||||
|
return LANG;
|
||||||
|
})))
|
||||||
|
|
||||||
// Authentication
|
// Authentication
|
||||||
.get('/api/session', Util.promisify(async (req) => {
|
.get('/api/session', Util.promisify(async (req) => {
|
||||||
const requiresPassword = !!process.env.PASSWORD;
|
const requiresPassword = !!process.env.PASSWORD;
|
||||||
|
@ -162,9 +166,6 @@ module.exports = class Server {
|
||||||
const { address } = req.body;
|
const { address } = req.body;
|
||||||
return WireGuard.updateClientAddress({ clientId, address });
|
return WireGuard.updateClientAddress({ clientId, address });
|
||||||
}))
|
}))
|
||||||
.get('/api/lang', (Util.promisify(async () => {
|
|
||||||
return LANG;
|
|
||||||
})))
|
|
||||||
|
|
||||||
.listen(PORT, WEBUI_HOST, () => {
|
.listen(PORT, WEBUI_HOST, () => {
|
||||||
debug(`Listening on http://${WEBUI_HOST}:${PORT}`);
|
debug(`Listening on http://${WEBUI_HOST}:${PORT}`);
|
||||||
|
|
|
@ -36,6 +36,13 @@ class API {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getLang() {
|
||||||
|
return this.call({
|
||||||
|
method: 'get',
|
||||||
|
path: '/lang',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async getSession() {
|
async getSession() {
|
||||||
return this.call({
|
return this.call({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -117,11 +124,4 @@ class API {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getLang() {
|
|
||||||
return this.call({
|
|
||||||
method: 'get',
|
|
||||||
path: '/lang',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue