Skip to content

Commit bdf13ab

Browse files
committed
Improve CSRF handling
1 parent f5a42f6 commit bdf13ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/client_auth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function call($method, $url, $data = false) {
2424
}
2525

2626
// 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);
2929

3030
unlink($cookiejar);
3131

0 commit comments

Comments
 (0)