mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
fix: login btn does not work for readonly annoymous (#620)
This commit is contained in:
@@ -211,7 +211,18 @@ impl Server {
|
||||
}
|
||||
|
||||
if method.as_str() == "CHECKAUTH" {
|
||||
*res.body_mut() = body_full(user.clone().unwrap_or_default());
|
||||
match user.clone() {
|
||||
Some(user) => {
|
||||
*res.body_mut() = body_full(user);
|
||||
}
|
||||
None => {
|
||||
if has_query_flag(&query_params, "login") || !access_paths.perm().readwrite() {
|
||||
self.auth_reject(&mut res)?
|
||||
} else {
|
||||
*res.body_mut() = body_full("");
|
||||
}
|
||||
}
|
||||
}
|
||||
return Ok(res);
|
||||
} else if method.as_str() == "LOGOUT" {
|
||||
self.auth_reject(&mut res)?;
|
||||
|
||||
Reference in New Issue
Block a user