temp - added explicit beta checks for some endpoints

This commit is contained in:
Jonathan Barrow 2023-10-03 14:47:18 -04:00
parent 88633eeb4c
commit d839969d0e
No known key found for this signature in database
GPG Key ID: E86E9FE9049C741F

View File

@ -86,6 +86,13 @@ async function auth(request: express.Request, response: express.Response, next:
return serverError(response, discovery);
}
// TODO - This is temp, testing something. Will be removed in the future
if (request.path !== '/v1/endpoint') {
if (user.serverAccessLevel !== 'test' && user.serverAccessLevel !== 'dev') {
return badAuth(response, 16, 'BAD_TOKEN');
}
}
// * This is a false positive from ESLint.
// * Since this middleware is only ever called
// * per every request instance