Auth fixes (#664)

* Auth fixes

* destroy flows after use

* fix comp err

* add bearer err msg
This commit is contained in:
Geometrically
2023-08-04 16:22:15 -07:00
committed by GitHub
parent 039d26feeb
commit ca0468b8d5
6 changed files with 19 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
use actix_web::HttpResponse;
use actix_web::{get, HttpResponse};
use serde_json::json;
#[get("/")]
pub async fn index_get() -> HttpResponse {
let data = json!({
"name": "modrinth-labrinth",

View File

@@ -1,5 +1,6 @@
use crate::file_hosting::FileHostingError;
use crate::util::cors::default_cors;
use actix_files::Files;
use actix_web::http::StatusCode;
use actix_web::{web, HttpResponse};
use futures::FutureExt;
@@ -15,7 +16,6 @@ mod updates;
pub use self::not_found::not_found;
pub fn root_config(cfg: &mut web::ServiceConfig) {
cfg.route("", web::get().wrap(default_cors()).to(index::index_get));
cfg.service(
web::scope("maven")
.wrap(default_cors())
@@ -39,6 +39,12 @@ pub fn root_config(cfg: &mut web::ServiceConfig) {
}.boxed_local()
})
);
cfg.service(
web::scope("")
.wrap(default_cors())
.service(index::index_get)
.service(Files::new("/", "assets/")),
);
}
#[derive(thiserror::Error, Debug)]