added feeds

This commit is contained in:
2023-09-17 11:54:37 +02:00
parent 018bbf3918
commit 43e5d473b7
21 changed files with 76 additions and 25 deletions
+5 -2
View File
@@ -1,4 +1,3 @@
use super::jwt;
use actix_web::dev::ServiceRequest;
@@ -10,9 +9,13 @@ pub fn check_password(password: String) -> Result<String, &'static str> {
}
pub fn extract_header_token(request: &ServiceRequest) -> Result<String, &'static str> {
log::info!("Request: {:?}", request);
match request.headers().get("user-token") {
Some(token) => match token.to_str() {
Ok(processed_password) => Ok(String::from(processed_password)),
Ok(processed_password) => {
log::info!("Token provided: {}", processed_password);
Ok(String::from(processed_password))
}
Err(_processed_password) => Err("there was an error processing token"),
},
None => Err("there is no token"),