From 620c2750eea63b2cbd0531f1ee6f4cb4985dc529 Mon Sep 17 00:00:00 2001 From: Udhay-Adithya Date: Thu, 19 Jun 2025 17:11:31 +0530 Subject: [PATCH] fix: change JWT generation failure handling to throw an exception instead of returning a basic JWT --- packages/apidash_core/lib/utils/auth_utils.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/apidash_core/lib/utils/auth_utils.dart b/packages/apidash_core/lib/utils/auth_utils.dart index 4e03b144..df6bf864 100644 --- a/packages/apidash_core/lib/utils/auth_utils.dart +++ b/packages/apidash_core/lib/utils/auth_utils.dart @@ -45,8 +45,7 @@ String generateJWT(AuthJwtModel jwtAuth) { return '$encodedHeader.$encodedPayload.$signature'; } catch (e) { - // Return a basic JWT if generation fails - return 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'; + throw Exception('Failed to generate JWT: $e'); } }