Files
shields/lib/github-auth/is-valid-token.js
Paul Melnikow b3ec3e7a96 Generalized rotating token pool (#1736)
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.
2018-07-11 23:08:56 -04:00

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;