fix(studio): don't double-quote the reset-password hint for spaced paths (#5975)

Addresses review feedback on #5971. _reset_password_command() already
shell-quotes the launcher path on POSIX (shlex.quote), so wrapping the result in
another pair of single quotes in the error string produced a mangled hint for
installs / home dirs containing spaces, e.g.

  Run ''/tmp/Unsloth Studio/.../unsloth' studio reset-password' in your terminal

which a shell mis-parses. Drop the outer quotes and put the command at the end of
the message so it is unambiguous and copy-pasteable in every case:

  Incorrect password. To reset it, run this in your terminal: <cmd>

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Daniel Han 2026-06-03 06:10:23 -07:00 committed by GitHub
commit aa0db1ff5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -260,7 +260,7 @@ async def login(payload: AuthLoginRequest, request: Request) -> Token:
_record_login_failure(unknown_key)
raise HTTPException(
status_code = status.HTTP_401_UNAUTHORIZED,
detail = f"Incorrect password. Run '{_reset_password_command()}' in your terminal to reset it.",
detail = f"Incorrect password. To reset it, run this in your terminal: {_reset_password_command()}",
)
salt, pwd_hash, _jwt_secret, must_change_password = record
@ -268,7 +268,7 @@ async def login(payload: AuthLoginRequest, request: Request) -> Token:
_record_login_failure(key)
raise HTTPException(
status_code = status.HTTP_401_UNAUTHORIZED,
detail = f"Incorrect password. Run '{_reset_password_command()}' in your terminal to reset it.",
detail = f"Incorrect password. To reset it, run this in your terminal: {_reset_password_command()}",
)
_clear_login_bucket(key)