Ver código fonte

Improve CSRF handling

Maurits van der Schee 7 anos atrás
pai
commit
bdf13ab0c8
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2
    2
      examples/client_auth.php

+ 2
- 2
examples/client_auth.php Ver arquivo

@@ -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
 

Carregando…
Cancelar
Salvar