Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Mike Cao 2023-11-29 14:03:22 -08:00
commit 5acc1f0f3c

View File

@ -8,6 +8,7 @@ import { findSession } from 'lib/session';
import {
badRequest,
createMiddleware,
forbidden,
parseSecureToken,
tooManyRequest,
unauthorized,
@ -38,6 +39,9 @@ export const useSession = createMiddleware(async (req, res, next) => {
if (e.message === 'Usage Limit.') {
return tooManyRequest(res, e.message);
}
if (e.message.startsWith('Website not found:')) {
return forbidden(res, e.message);
}
return badRequest(res, e.message);
}