better logging for sdk auth
This commit is contained in:
@@ -17,7 +17,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
) => {
|
||||
try {
|
||||
const projectId = await validateSdkRequest(req.headers).catch(
|
||||
() => null
|
||||
req.log.error
|
||||
);
|
||||
if (!projectId) {
|
||||
return reply.status(401).send();
|
||||
|
||||
@@ -6,7 +6,9 @@ import type { FastifyPluginCallback } from 'fastify';
|
||||
const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
fastify.addHook('preHandler', async (req, reply) => {
|
||||
try {
|
||||
const projectId = await validateSdkRequest(req.headers).catch(() => null);
|
||||
const projectId = await validateSdkRequest(req.headers).catch(
|
||||
req.log.error
|
||||
);
|
||||
if (!projectId) {
|
||||
return reply.status(401).send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user