Sha256: c32ca6a5c23db81a3b102ad8f9056c87b81430ba51ad664b35dd027ccfc14f6b

Contents?: true

Size: 523 Bytes

Versions: 36

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true

class DemoUserController < ApplicationController
  before_action :authenticate_user!

  def members_only
    render json: {
      data: {
        message: "Welcome #{current_user.name}",
        user: current_user
      }
    }, status: 200
  end

  def members_only_remove_token
    u = User.find(current_user.id)
    u.tokens = {}
    u.save!

    render json: {
      data: {
        message: "Welcome #{current_user.name}",
        user: current_user
      }
    }, status: 200
  end
end

Version data entries

36 entries across 36 versions & 9 rubygems

Version Path
devise_token_auth-1.2.5 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth722-0.1.7 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth7-0.1.7 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth-1.2.4 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth-1.2.2 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.4.1 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.4.0 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.3.0 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth-1.2.1 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.2.0 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth-1.2.0 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth-1.1.5 test/dummy/app/controllers/demo_user_controller.rb
sidecar_token_auth-1.0.1 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.1.7 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.1.6 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth-1.1.4 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth_multitenancy-1.1.3.2 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth_multitenancy-1.1.3.1 test/dummy/app/controllers/demo_user_controller.rb
devise_token_auth_multitenancy-1.1.3.alpha1 test/dummy/app/controllers/demo_user_controller.rb
devise_jwt_auth-0.1.5 test/dummy/app/controllers/demo_user_controller.rb