Skip to content

Instantly share code, notes, and snippets.

@nickpoorman
Last active November 26, 2016 14:25
Show Gist options
  • Save nickpoorman/cbd39734fbdcc66049a69d5309844045 to your computer and use it in GitHub Desktop.
Save nickpoorman/cbd39734fbdcc66049a69d5309844045 to your computer and use it in GitHub Desktop.
# app/controllers/application_controller.rb
class ApplicationController < ActionController::API
include Pundit
# set current_user from token
include DeviseTokenAuth::Concerns::SetUserByToken
# For this example we will stub out `current_user`
# For Pundit, you may want to override `pundit_user`
def current_user
User.find(1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment