From 14073e577022173cae15d0082c3695a80e6212da Mon Sep 17 00:00:00 2001 From: Amin Latifi Date: Tue, 22 Oct 2024 17:55:51 +0330 Subject: [PATCH] Prevent undefined issue --- src/server/bootstrap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/bootstrap.ts b/src/server/bootstrap.ts index 608e128dc..9b692cadb 100644 --- a/src/server/bootstrap.ts +++ b/src/server/bootstrap.ts @@ -252,7 +252,7 @@ export async function bootstrap() { const { headers } = req; const authVersion = headers?.authversion || '1'; if (headers?.authorization) { - token = headers.authorization?.split(' ')[1].toString(); + token = headers.authorization?.split(' ')[1]?.toString(); if (!token) { throw new Error('Authorization token is missing'); }