mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-18 03:31:03 +01:00
feat: log the last time a valid api token was seen, have v3 ping route go through setupApiRoute helper
This commit is contained in:
11
src/api/utils.js
Normal file
11
src/api/utils.js
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const db = require('../database');
|
||||
|
||||
const utils = module.exports;
|
||||
|
||||
// internal token management utilities only
|
||||
|
||||
utils.log = async (token) => {
|
||||
await db.sortedSetAdd('tokens:lastSeen', Date.now(), token);
|
||||
};
|
||||
Reference in New Issue
Block a user