Sha256: bc5e898e36ec44e04d823f58514245b1cca0b7ee610872d06b02f26ad37ba96e

Contents?: true

Size: 546 Bytes

Versions: 3

Compression:

Stored size: 546 Bytes

Contents

module Dashing
  class ApplicationController < ActionController::Base

    before_action :authentication_with_devise

    private

    def authentication_with_devise
      Dashing.config.devise_allowed_models.each do |model|
        send("authenticate_#{model.to_s}!")
      end
    end

    def check_accessibility
      auth_token = params.delete(:auth_token)
      if !Dashing.config.auth_token || auth_token == Dashing.config.auth_token
        true
      else
        render nothing: true, status: 401 and return
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dashing-rails-2.6.2 app/controllers/dashing/application_controller.rb
dashing-rails-2.6.1 app/controllers/dashing/application_controller.rb
dashing-rails-2.6.0 app/controllers/dashing/application_controller.rb