chore: silent for no auth token
This commit is contained in:
parent
bfd480349e
commit
b7df108967
@ -361,12 +361,22 @@ impl ReqTasks {
|
|||||||
}
|
}
|
||||||
#[allow(clippy::missing_errors_doc)]
|
#[allow(clippy::missing_errors_doc)]
|
||||||
pub async fn user_authentication(&self) -> anyhow::Result<UserCtx> {
|
pub async fn user_authentication(&self) -> anyhow::Result<UserCtx> {
|
||||||
let token = self.token_from_header().unwrap_or_else(|e| { println!("{}",e); String::from("")});
|
let token = self.token_from_header().unwrap_or_else(|e| {
|
||||||
|
if envmnt::get_isize("DEBUG", 0) > 0 {
|
||||||
|
println!("{}",e);
|
||||||
|
}
|
||||||
|
String::from("")
|
||||||
|
});
|
||||||
self.check_authentication(token).await
|
self.check_authentication(token).await
|
||||||
}
|
}
|
||||||
#[allow(clippy::missing_errors_doc)]
|
#[allow(clippy::missing_errors_doc)]
|
||||||
pub async fn user_role(&self) -> String {
|
pub async fn user_role(&self) -> String {
|
||||||
let token = self.token_from_header().unwrap_or_else(|e| { println!("{}",e); String::from("")});
|
let token = self.token_from_header().unwrap_or_else(|e| {
|
||||||
|
if envmnt::get_isize("DEBUG", 0) > 0 {
|
||||||
|
println!("{}",e);
|
||||||
|
}
|
||||||
|
String::from("")
|
||||||
|
});
|
||||||
if token.is_empty() {
|
if token.is_empty() {
|
||||||
return String::from("");
|
return String::from("");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user