Sha256: 51bd36e29b921a1b5f839559ca236e819dc80cebdc906690eabb1bd3e4c413e9

Contents?: true

Size: 323 Bytes

Versions: 37

Compression:

Stored size: 323 Bytes

Contents

class DemoController < ApplicationController
  def members_only
    if @user
      render json: {
        data: {
          message: "Welcome #{@user.name}",
          user: @user
        }
      }, status: 200
    else
      render json: {
        errors: ["Authorized users only."]
      }, status: 401
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
devise_token_auth-0.1.28.beta6 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.28.beta5 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.28.beta4 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.28.beta3 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.28.beta2 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.28.beta1 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.27 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.27.beta3 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.27.beta2 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.27.beta1 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.26 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.26.beta3 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.26.beta2 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.26.beta1 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.25 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.25.beta1 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.24 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.23 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.23.alpha1 test/dummy/app/controllers/demo_controller.rb
devise_token_auth-0.1.21.alpha2 test/dummy/app/controllers/demo_controller.rb