mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 02:39:19 +08:00
fix: change JWT generation failure handling to throw an exception instead of returning a basic JWT
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user