Skip to content

Commit f5a42f6

Browse files
committed
Improve CSRF handling
1 parent bef88a9 commit f5a42f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/client_angular2_auth.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
};
2424
var url = "../api.php";
2525
http.post(url,JSON.stringify({username:"admin",password:"admin"})).subscribe(res => {
26-
url += "/posts?csrf="+res._body;
26+
url += "/posts?csrf="+JSON.parse(res._body);
2727
http.post(url,JSON.stringify({user_id:1,category_id:1,content:"from angular2"})).subscribe();
2828
http.get(url).map(res => php_crud_api_transform(res.json())).subscribe(res => this.posts = res.posts);
2929
});

0 commit comments

Comments
 (0)