Skip to content

Commit 06bd857

Browse files
committed
Check empty input for login
Signed-off-by: hi-rustin <[email protected]>
1 parent a3e352e commit 06bd857

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cargo/ops/registry.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,11 @@ pub fn registry_login(
764764
.with_context(|| "failed to read stdin")?;
765765
// Automatically remove `cargo login` from an inputted token to
766766
// allow direct pastes from `registry.host()`/me.
767-
line.replace("cargo login", "").trim().to_string()
767+
line.replace("cargo login", "").trim().to_string();
768+
if line.is_empty() {
769+
bail!("please provide a non-empty token");
770+
}
771+
line
768772
}
769773
};
770774

0 commit comments

Comments
 (0)