Skip to content

Commit

Permalink
Add Access Control for Edit-Recipe Tab (#15)
Browse files Browse the repository at this point in the history
Currently, everybody can edit all recipes to their liking.
This commit should move the edit recipe router (and with that the edit recipe
API) to the Authenticated Layer.
  • Loading branch information
isiko authored Apr 4, 2024
1 parent 58ba80c commit 25217e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/frontend/recipes_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) fn recipes_router() -> axum::Router<MyAppState> {
"/delete_nqa/:recipe_id",
axum::routing::delete(delete_recipe_nqa),
)
.nest("/edit/", recipes_edit_tab::recipes_edit_router())
.route_layer(RequireAuthorizationLayer::<i64, User>::login_or_redirect(
Arc::new(LOGIN_URL.into()),
None,
Expand All @@ -34,7 +35,6 @@ pub(crate) fn recipes_router() -> axum::Router<MyAppState> {
axum::routing::get(export_recipe_pdf),
)
.route("/", axum::routing::get(recipes_view))
.nest("/edit/", recipes_edit_tab::recipes_edit_router())
}

#[derive(Deserialize)]
Expand Down

0 comments on commit 25217e5

Please sign in to comment.