diff options
Diffstat (limited to 'server')
| -rw-r--r-- | server/src/auth.rs | 7 | ||||
| -rw-r--r-- | server/src/main.rs | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/server/src/auth.rs b/server/src/auth.rs index 4e66448..7cb2d54 100644 --- a/server/src/auth.rs +++ b/server/src/auth.rs @@ -237,7 +237,8 @@ fn unauthorized() -> Json<api_model::StatusResponse> { Json(STATUS_UNAUTHORIZED) } -pub fn stage(basepath: String) -> AdHoc { +pub fn stage(basepath: &str) -> AdHoc { + let l_basepath = basepath.to_string(); AdHoc::on_ignite("Auth Stage", |rocket| async { rocket .manage(Sessions { @@ -247,7 +248,7 @@ pub fn stage(basepath: String) -> AdHoc { }), }) .attach(AdHoc::config::<AuthConfig>()) - .mount(basepath.clone(), routes![login, logout, status]) - .register(basepath, catchers![unauthorized]) + .mount(l_basepath.clone(), routes![login, logout, status]) + .register(l_basepath, catchers![unauthorized]) }) } diff --git a/server/src/main.rs b/server/src/main.rs index 124d914..b8b4b64 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -317,7 +317,7 @@ async fn main() -> Result<(), rocket::Error> { "/", SwaggerUi::new("/openapi/ui/<_..>").url("/openapi/openapi.json", api), ) - .attach(auth::stage(basepath.to_string())) + .attach(auth::stage(basepath)) .launch() .await?; |
