Sha256: fa630b6e0f9b3bb7189d708979dbf1ac847a8d5f8f94263ca01e4cec99413471
Contents?: true
Size: 382 Bytes
Versions: 1
Compression:
Stored size: 382 Bytes
Contents
module AngularRailsCsrf module Concern extend ActiveSupport::Concern included do after_action :set_xsrf_token_cookie end def set_xsrf_token_cookie cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery? end def verified_request? super || form_authenticity_token == request.headers['X-XSRF-TOKEN'] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
angular_rails_csrf-1.0.1 | lib/angular_rails_csrf/concern.rb |