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:
parent
37fd76a02f
commit
aa0db1ff5b
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue