Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to detect if the response is a CSRF failure or not #3

Merged
merged 2 commits into from
Jun 23, 2016

Conversation

mdamien
Copy link
Contributor

@mdamien mdamien commented Jun 23, 2016

No description provided.

@@ -42,7 +42,8 @@ csrfToken.setToken('updated-csrf-token');
To be able to get a new token if the current one expired you need to pass a retry object for the config with two keys:

* `url`: URL to request the new token
* `parseResponse`: A function that takes the request response as a parameter and return the new token
* `parseResponse`: A function that takes the token request response as a parameter and return the new token
* `isCSRFFailure` (optional): A function that takes the failed request response as a parameter and return true if it's a CSRF failure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide an example? If I would need to use this function I'd have no idea how to get the status code or response body

@SpaceK33z SpaceK33z merged commit fbee8ea into CodeYellowBV:master Jun 23, 2016
@mdamien mdamien deleted the config-is-csrf-failure branch June 23, 2016 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants