mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-10 04:05:34 +00:00
fixed some old TODOs
This commit is contained in:
@@ -134,6 +134,11 @@ const conf = convict({
|
||||
format: String,
|
||||
default: '', // disabled
|
||||
env: 'FXA_CLIENT_ID'
|
||||
},
|
||||
fxa_key_scope: {
|
||||
format: String,
|
||||
default: 'https://identity.mozilla.com/apps/send',
|
||||
env: 'FXA_KEY_SCOPE'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const fetch = require('node-fetch');
|
||||
const config = require('./config');
|
||||
|
||||
const KEY_SCOPE = 'https://identity.mozilla.com/apps/send';
|
||||
const KEY_SCOPE = config.fxa_key_scope;
|
||||
let fxaConfig = null;
|
||||
let lastConfigRefresh = 0;
|
||||
|
||||
@@ -14,6 +14,7 @@ async function getFxaConfig() {
|
||||
{ timeout: 3000 }
|
||||
);
|
||||
fxaConfig = await res.json();
|
||||
fxaConfig.key_scope = KEY_SCOPE;
|
||||
lastConfigRefresh = Date.now();
|
||||
return fxaConfig;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ module.exports = {
|
||||
await storage.set(
|
||||
id(req.user),
|
||||
fileStream,
|
||||
{ n: 'a' }, //TODO
|
||||
null,
|
||||
config.max_expire_seconds
|
||||
);
|
||||
res.sendStatus(200);
|
||||
|
||||
@@ -52,7 +52,9 @@ class DB {
|
||||
const filePath = `${prefix}-${id}`;
|
||||
await this.storage.set(filePath, file);
|
||||
this.redis.hset(id, 'prefix', prefix);
|
||||
this.redis.hmset(id, meta);
|
||||
if (meta) {
|
||||
this.redis.hmset(id, meta);
|
||||
}
|
||||
this.redis.expire(id, expireSeconds);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user