Sha256: e4dc40df15c2ac3505c950a3b3cb81c96d817d4309697f4d6f1130d50611f752

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

class CustomAuthenticatedController < ApplicationController

  include RailsApiAuth::Authentication

  if Rails::VERSION::MAJOR < 4
    before_filter :authenticate_with_account!
  else
    before_action :authenticate_with_account!
  end

  def index
    if Rails::VERSION::MAJOR < 4
      render text: 'zuper content', status: 200
    else
      render plain: 'zuper content', status: 200
    end
  end

  private

    def authenticate_with_account!
      authenticate! do
        current_login.account.first_name == 'user x'
      end
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_api_auth-0.0.8 spec/dummy/app/controllers/custom_authenticated_controller.rb
rails_api_auth-0.0.7 spec/dummy/app/controllers/custom_authenticated_controller.rb