mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 18:57:05 +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';
|
return '$encodedHeader.$encodedPayload.$signature';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Return a basic JWT if generation fails
|
throw Exception('Failed to generate JWT: $e');
|
||||||
return 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user