Skip to content

Instantly share code, notes, and snippets.

@BenMorganIO
Created April 8, 2016 04:48
Show Gist options
  • Select an option

  • Save BenMorganIO/2231b6bd84c0811020a92feb9781986b to your computer and use it in GitHub Desktop.

Select an option

Save BenMorganIO/2231b6bd84c0811020a92feb9781986b to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
before_action :authenticate_user!
private
def authenticate_user!
token = params[:token].presence
@current_user = User.find_by(token: token)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment