diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-04-06 21:29:15 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-04-06 21:29:15 -0500 |
commit | 9a6c04d52edb10431f9f5ca2dbc83c410cb5daee (patch) | |
tree | ab6771edec6accbbe6e20a0cb0124390a372d576 /src | |
parent | 9822bc18bb0cb5e13104376ecefc6ec99d93b016 (diff) |
fix: enable permissive cors middleware
Diffstat (limited to 'src')
-rw-r--r-- | src/routes.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/routes.rs b/src/routes.rs index 165dfb6..897b3cb 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -6,6 +6,7 @@ use axum::{ response::IntoResponse, }; use axum_extra::routing::RouterExt; +use tower_http::cors::CorsLayer; use crate::{jwt::authenticate, state::AppState}; @@ -24,6 +25,7 @@ pub fn init_router(state: Arc<AppState>) -> axum::Router { .typed_get(user::UserUuid::get) .typed_post(register::Register::post) .typed_post(login::Login::post) + .layer(CorsLayer::permissive()) .fallback(fallback) .with_state(state) } |