瀏覽代碼

fix auth example

Evan Almloff 2 年之前
父節點
當前提交
fd98b51dfe
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/fullstack/examples/axum-auth/src/main.rs

+ 1 - 1
packages/fullstack/examples/axum-auth/src/main.rs

@@ -149,7 +149,7 @@ pub async fn get_permissions(
     let current_user = auth.current_user.clone().unwrap_or_default();
     let current_user = auth.current_user.clone().unwrap_or_default();
 
 
     // lets check permissions only and not worry about if they are anon or not
     // lets check permissions only and not worry about if they are anon or not
-    if !axum_session_auth::Auth::<crate::auth::User, i64, sqlx::SqlitePool>::build([axum::http::Method::GET], false)
+    if !axum_session_auth::Auth::<crate::auth::User, i64, sqlx::SqlitePool>::build([axum::http::Method::POST], false)
         .requires(axum_session_auth::Rights::any([
         .requires(axum_session_auth::Rights::any([
             axum_session_auth::Rights::permission("Category::View"),
             axum_session_auth::Rights::permission("Category::View"),
             axum_session_auth::Rights::permission("Admin::View"),
             axum_session_auth::Rights::permission("Admin::View"),