Sha256: 2c5b3dd11ebf1f9bbf1a6f33072e0e526459e4bf881c84a9b6c0da828ce1c944

Contents?: true

Size: 532 Bytes

Versions: 11

Compression:

Stored size: 532 Bytes

Contents

module SocialNetworking
  module Concerns
    # Rescues exception when authenticity token has expired
    module InvalidAuthToken
      extend ActiveSupport::Concern

      included do
        rescue_from ActionController::InvalidAuthenticityToken,
                    with: :invalid_auth_token_redirect
      end

      private

      def invalid_auth_token_redirect
        redirect_to "/",
                    alert: "Your authenticity token expired. "\
                           "Please try again."
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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