Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
For Strapi v3.5.3 users-permissions, what happens ifextensions/users-permissions/config/jwt.jssetsjwtSecretto an empty string? Does authentication fail, or can tokens be signed/verified with empty secret?💡 Result:
If
extensions/users-permissions/config/jwt.jssetsjwtSecretto an empty string in Strapi v3.5.3, authentication will not work with Strapi-issued JWTs (and you should expect JWT signing/verification to fail). Reasoning grounded in Strapi’s own JWT configuration guidance: Strapi’s Users & Permissions JWTs are digitally signed, and “to sign a token a secret is required”. Strapi’s default behavior is to generate/store a secret inextensions/users-permissions/config/jwt.js, and it recommends supplying a customJWT_SECRETvia environment variable for production use [1][2]. That implies Strapi requires a non-empty secret value for HMAC signing and verification. Additionally, Strapi’s users-permissions plugin has been observed to error when the JWT secret is missing/invalid rather than silently accepting it (e.g., “Missing jwtSecret. Please, set configuration variable ‘jwtSecret’ …” reported by users when configuration isn’t present) [3]. While those reports don’t explicitly mention the empty-string case, the security requirement (“secret is required”) and the plugin’s behavior for missing configuration strongly indicate that an empty string will be treated as an unusable secret for signing/verifying. Practical conclusion: setjwtSecretto a non-empty value (recommended: a strong random value provided viaJWT_SECRET), not''[1][2]. If you currently have'', update it and ensure any already-issued tokens are regenerated.Citations:
🏁 Script executed:
Repository: opentiny/tiny-engine-data-center
Length of output: 750
🏁 Script executed:
Repository: opentiny/tiny-engine-data-center
Length of output: 915
🏁 Script executed:
Repository: opentiny/tiny-engine-data-center
Length of output: 1151
Require
JWT_SECRETenvironment variable at startup; do not fall back to empty string.The empty-string fallback at line 13 will cause JWT operations to fail at runtime. Strapi v3.5.3 users-permissions requires a non-empty secret for signing and verifying tokens. Fail fast during configuration by throwing if
JWT_SECRETis absent, rather than deferring the error to auth endpoints.Suggested fix
🤖 Prompt for AI Agents