feat: log the last time a valid api token was seen, have v3 ping route go through setupApiRoute helper

This commit is contained in:
Julian Lam
2023-03-20 11:26:49 -04:00
parent 7c780210a8
commit efa64032dd
5 changed files with 27 additions and 2 deletions

11
src/api/utils.js Normal file
View 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);
};