diff options
Diffstat (limited to 'src/filters/auth')
-rw-r--r-- | src/filters/auth/cookie.rs | 3 | ||||
-rw-r--r-- | src/filters/auth/login.html (renamed from src/filters/auth/cookie.html) | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/filters/auth/cookie.rs b/src/filters/auth/cookie.rs index c1847ce..620911d 100644 --- a/src/filters/auth/cookie.rs +++ b/src/filters/auth/cookie.rs @@ -52,7 +52,7 @@ impl Node for CookieAuth { request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<NodeResponse, ServiceError>> + Send + Sync + 'a>> { Box::pin(async move { - if request.method() == Method::POST { + if request.method() == Method::POST && request.uri().path() == "/_gnix_login" { let referrer = request.headers().get(REFERER).cloned(); let d = request .into_body() @@ -62,6 +62,7 @@ impl Node for CookieAuth { .unwrap(); let d = String::from_utf8(d.to_bytes().to_vec()).unwrap(); + // TODO proper parser let mut username = "user"; let mut password = ""; for kv in d.split("&") { diff --git a/src/filters/auth/cookie.html b/src/filters/auth/login.html index 40bb157..c7782bd 100644 --- a/src/filters/auth/cookie.html +++ b/src/filters/auth/login.html @@ -3,7 +3,7 @@ <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <title>Document</title> + <title>Gnix Login</title> <style> body { background-color: grey; |