feat: ui improves the login experience (#182)

close #157 #158
This commit is contained in:
sigoden
2023-02-21 12:42:40 +08:00
committed by GitHub
parent a61fda6e80
commit 6d9758c71d
6 changed files with 164 additions and 34 deletions

View File

@@ -45,6 +45,20 @@ fn auth_skip_on_options_method(
Ok(())
}
#[rstest]
fn auth_check(
#[with(&["--auth", "/@user:pass@user2:pass2", "-A"])] server: TestServer,
) -> Result<(), Error> {
let url = format!("{}index.html?auth", server.url());
let resp = fetch!(b"GET", &url).send()?;
assert_eq!(resp.status(), 401);
let resp = fetch!(b"GET", &url).send_with_digest_auth("user2", "pass2")?;
assert_eq!(resp.status(), 401);
let resp = fetch!(b"GET", &url).send_with_digest_auth("user", "pass")?;
assert_eq!(resp.status(), 200);
Ok(())
}
#[rstest]
fn auth_readonly(
#[with(&["--auth", "/@user:pass@user2:pass2", "-A"])] server: TestServer,