Can disable auth
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use std::future::{ready, Ready};
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::constants;
|
||||
use crate::extractors::auth_extractor::AuthExtractor;
|
||||
use actix_web::body::EitherBody;
|
||||
@ -60,8 +61,10 @@ where
|
||||
let service = Rc::clone(&self.service);
|
||||
|
||||
Box::pin(async move {
|
||||
let auth_disabled = AppConfig::get().unsecure_disable_auth;
|
||||
|
||||
// Check authentication, if required
|
||||
if !constants::ROUTES_WITHOUT_AUTH.contains(&req.path()) {
|
||||
if !auth_disabled && !constants::ROUTES_WITHOUT_AUTH.contains(&req.path()) {
|
||||
let auth = match AuthExtractor::from_request(req.request(), &mut Payload::None)
|
||||
.into_inner()
|
||||
{
|
||||
|
Reference in New Issue
Block a user