expressjs / csurf

CSRF token middleware
MIT License
2.3k stars 216 forks source link

Add an example of using in single page application #175

Closed zelongc closed 5 years ago

zelongc commented 5 years ago

An example of using the package in a SPA, as suggested in issue https://github.com/expressjs/csurf/issues/174

dougwilson commented 5 years ago

Awesome, thank you @zelongc !

I know there was some issue (or more) asking for SPA examples. I wanted to ask some of those folks to review this as the end users of the information, but the issue you linked to, #111 , doesn't seem to be about SPAs, and I don't see anywhere in that issue there being a suggesting to add this doc. Is there a different issue you meant to reference and/or can you call in some folks that you saw were asking for this to help review? Thanks!

zelongc commented 5 years ago

@dougwilson Thanks, it looks I need to fix the lint issue in the readme. I made a mistake in the issue number, it's fixed now. The correct issue number should be #174