Browse Source

Improve CSRF handling

Maurits van der Schee 7 years ago
parent
commit
f5a42f6079
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      examples/client_angular2_auth.html

+ 1
- 1
examples/client_angular2_auth.html View File

@@ -23,7 +23,7 @@ AppComponent =
23 23
         };
24 24
         var url = "../api.php";
25 25
         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);
27 27
           http.post(url,JSON.stringify({user_id:1,category_id:1,content:"from angular2"})).subscribe();
28 28
           http.get(url).map(res => php_crud_api_transform(res.json())).subscribe(res => this.posts = res.posts);
29 29
         });

Loading…
Cancel
Save