Description
When running JSS with --single-user-name followed directly by another flag (like --idp), the CLI silently accepts the flag as the username value instead of warning or erroring.
Steps to Reproduce
jss start --single-user-name --idp --idp-issuer https://example.com/
Expected Behavior
The CLI should either:
- Error with a message like:
Error: --single-user-name requires a value
- Or warn:
Warning: username "--idp" looks like a flag. Did you forget to provide a value?
Actual Behavior
- JSS silently uses
--idp as the username
- The
--idp flag is not recognized as enabling the identity provider
- The OIDC endpoints (
/.well-known/openid-configuration) return 404
- Users see confusing errors like:
Dynamic Registration could not be completed because the issuer has no registration endpoint
The startup message shows:
Single-user: --idp (registration disabled)
...indicating --idp was interpreted as the username, not as a flag.
Suggested Fix
Add validation in the CLI argument parsing:
if (username && username.startsWith('--')) {
console.error(`Error: --single-user-name value "${username}" looks like a flag.`);
console.error('Did you forget to provide a username? Example: --single-user-name melvin');
process.exit(1);
}
Environment
- JSS version: 0.0.79
- Node.js: v22.21.0
Description
When running JSS with
--single-user-namefollowed directly by another flag (like--idp), the CLI silently accepts the flag as the username value instead of warning or erroring.Steps to Reproduce
Expected Behavior
The CLI should either:
Error: --single-user-name requires a valueWarning: username "--idp" looks like a flag. Did you forget to provide a value?Actual Behavior
--idpas the username--idpflag is not recognized as enabling the identity provider/.well-known/openid-configuration) return 404Dynamic Registration could not be completed because the issuer has no registration endpointThe startup message shows:
...indicating
--idpwas interpreted as the username, not as a flag.Suggested Fix
Add validation in the CLI argument parsing:
Environment