Skip to content

Commit

Permalink
fix: if auth is disabled, don't use it for swagger ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Apr 25, 2024
1 parent 58823a6 commit 1929f8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ impl InitData {
log::warn!("Authentication is disabled");
}

let swagger_oidc: Option<Arc<SwaggerUiOidc>> =
SwaggerUiOidc::from_devmode_or_config(run.devmode, run.swagger_ui_oidc)
let swagger_oidc = match authenticator.is_some() {
true => SwaggerUiOidc::from_devmode_or_config(run.devmode, run.swagger_ui_oidc)
.await?
.map(Arc::new);
.map(Arc::new),
false => None,
};

let db = db::Database::new(&run.database).await?;
let graph = Graph::new(db.clone());
Expand Down

0 comments on commit 1929f8b

Please sign in to comment.