Created
August 21, 2013 10:16
-
-
Save dgertych-monterail/6292747 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController < ActionController::Base | |
| # Turn on request forgery protection | |
| protect_from_forgery | |
| after_filter :set_csrf_cookie_for_ng | |
| def set_csrf_cookie_for_ng | |
| cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery? | |
| end | |
| protected | |
| def verified_request? | |
| super || form_authenticity_token == request.headers['X_XSRF_TOKEN'] | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment