This was designed as part of a rewrite of the Github auth code in #1205 which is stalled because I don't want to deploy it without access to server logs. The need for token rotation came up recently in #541, so I picked up this code, removed the github-specific bits, and pulled it in. Ordinarily I wouldn't merge helper code without a use, though sadly it seems like the best way to move forward this rewrite.
9 lines
195 B
JavaScript
9 lines
195 B
JavaScript
'use strict';
|
|
|
|
// This is only used by the TokenProviders, though probably the acceptor
|
|
// should use it too.
|
|
|
|
const isValidToken = t => /^[0-9a-f]{40}$/.test(t);
|
|
|
|
module.exports = isValidToken;
|