From 2bc387920cd0a23fa302833f99af5ad477f6615b Mon Sep 17 00:00:00 2001 From: Hubert Date: Tue, 20 Jul 2021 07:03:14 +0200 Subject: [PATCH] save --- src/main.rs | 1 + src/webutils/auth.rs | 5 +++++ src/webutils/mod.rs | 1 + 3 files changed, 7 insertions(+) create mode 100644 src/webutils/auth.rs create mode 100644 src/webutils/mod.rs diff --git a/src/main.rs b/src/main.rs index c9149ef..a1caad4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,7 @@ mod gitust; mod error; mod web; mod gitutils; +mod webutils; #[derive(Template)] #[template(path = "hello.html")] diff --git a/src/webutils/auth.rs b/src/webutils/auth.rs new file mode 100644 index 0000000..7277437 --- /dev/null +++ b/src/webutils/auth.rs @@ -0,0 +1,5 @@ +use actix_web_httpauth::extractors::basic::BasicAuth; + +pub fn check_user(auth : BasicAuth) -> bool { + auth.user_id() == auth. +} \ No newline at end of file diff --git a/src/webutils/mod.rs b/src/webutils/mod.rs new file mode 100644 index 0000000..5696e21 --- /dev/null +++ b/src/webutils/mod.rs @@ -0,0 +1 @@ +pub mod auth; \ No newline at end of file