mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-18 18:01:20 +02:00
feat: api token migration, new ACP tokens list, token creation
This commit is contained in:
@@ -111,14 +111,6 @@ settingsController.social = async function (req, res) {
|
||||
};
|
||||
|
||||
settingsController.api = async (req, res) => {
|
||||
const { tokens } = await meta.settings.get('core.api');
|
||||
const scores = await api.utils.tokens.getLastSeen(tokens.map(t => t.token));
|
||||
|
||||
const [lastSeen, lastSeenISO] = tokens.reduce((memo, cur, idx) => {
|
||||
memo[0][cur.token] = scores[idx];
|
||||
memo[1][cur.token] = new Date(scores[idx]).toISOString();
|
||||
return memo;
|
||||
}, [{}, {}]);
|
||||
|
||||
res.render('admin/settings/api', { lastSeen, lastSeenISO });
|
||||
const tokens = await api.utils.tokens.list();
|
||||
res.render('admin/settings/api', { tokens });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user