瀏覽代碼

Improve CSRF handling

Maurits van der Schee 7 年之前
父節點
當前提交
bdf13ab0c8
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      examples/client_auth.php

+ 2
- 2
examples/client_auth.php 查看文件

@@ -24,8 +24,8 @@ function call($method, $url, $data = false) {
24 24
 }
25 25
 
26 26
 // in case you are using php-api-auth:
27
-$csrf = call('POST','http://localhost/blog.php/', 'username=admin&password=admin');
28
-$response = call('GET','http://localhost/blog.php/posts?include=categories,tags,comments&filter=id,eq,1&csrf='. trim($csrf));
27
+$csrf = json_decode(call('POST','http://localhost/api.php/', 'username=admin&password=admin'));
28
+$response = call('GET','http://localhost/api.php/posts?include=categories,tags,comments&filter=id,eq,1&csrf='. $csrf);
29 29
 
30 30
 unlink($cookiejar);
31 31
 

Loading…
取消
儲存