feat: Prefix api keys

This commit is contained in:
Tom Moor
2022-12-03 18:21:33 -05:00
parent 0f31d5b45f
commit d6d1eb4485
4 changed files with 36 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ export default function auth(options: AuthenticationOptions = {}) {
let user: User | null | undefined;
if (token) {
if (String(token).match(/^[\w]{38}$/)) {
if (ApiKey.match(String(token))) {
ctx.state.authType = AuthenticationType.API;
let apiKey;