mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
feat(writeapi): token generation/delete routes, ACP updates
This commit is contained in:
@@ -169,6 +169,23 @@ Plugins.reload = async function () {
|
||||
return { plugin, settings, quiet };
|
||||
},
|
||||
});
|
||||
Plugins.registerHook('core', {
|
||||
hook: 'filter:settings.get',
|
||||
method: async ({ plugin, values }) => {
|
||||
if (plugin === 'core.api' && Array.isArray(values.tokens)) {
|
||||
values.tokens = values.tokens.map((tokenObj) => {
|
||||
tokenObj.uid = parseInt(tokenObj.uid, 10);
|
||||
if (tokenObj.timestamp) {
|
||||
tokenObj.timestampISO = new Date(parseInt(tokenObj.timestamp, 10)).toISOString();
|
||||
}
|
||||
|
||||
return tokenObj;
|
||||
});
|
||||
}
|
||||
|
||||
return { plugin, values };
|
||||
},
|
||||
});
|
||||
|
||||
// Lower priority runs earlier
|
||||
Object.keys(Plugins.loadedHooks).forEach(function (hook) {
|
||||
|
||||
Reference in New Issue
Block a user