Sha256: 2482536ad014d8b41519087ea6081cf5c9b2a4d6d6f25b98fc5cdbcf96e35e68

Contents?: true

Size: 689 Bytes

Versions: 11

Compression:

Stored size: 689 Bytes

Contents

module SocialNetworking
  # Top level engine controller
  # Inherits from host's ApplicationController.
  class ApplicationController < ::ApplicationController
    include Concerns::InvalidAuthToken

    CSRF_COOKIE_NAME = "XSRF-TOKEN"
    CSRF_HEADER_NAME = "X-XSRF-TOKEN"

    before_action :authenticate_participant!
    after_action :set_csrf_cookie_for_ng

    layout "tool"

    protected

    def verified_request?
      super ||
        valid_authenticity_token?(session, request.headers[CSRF_HEADER_NAME])
    end

    private

    def set_csrf_cookie_for_ng
      return unless protect_against_forgery?
      cookies[CSRF_COOKIE_NAME] = form_authenticity_token
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
social_networking-0.11.8 app/controllers/social_networking/application_controller.rb
social_networking-0.11.7 app/controllers/social_networking/application_controller.rb
social_networking-0.11.6 app/controllers/social_networking/application_controller.rb
social_networking-0.11.5 app/controllers/social_networking/application_controller.rb
social_networking-0.11.4 app/controllers/social_networking/application_controller.rb
social_networking-0.11.3 app/controllers/social_networking/application_controller.rb
social_networking-0.11.2 app/controllers/social_networking/application_controller.rb
social_networking-0.11.1 app/controllers/social_networking/application_controller.rb
social_networking-0.11.0 app/controllers/social_networking/application_controller.rb
social_networking-0.10.0 app/controllers/social_networking/application_controller.rb
social_networking-0.9.3 app/controllers/social_networking/application_controller.rb