Skip to content

Instantly share code, notes, and snippets.

@jmmastey
Created December 12, 2014 21:43
Show Gist options
  • Save jmmastey/1e3558b5a488910b76f4 to your computer and use it in GitHub Desktop.
Save jmmastey/1e3558b5a488910b76f4 to your computer and use it in GitHub Desktop.
def auth_by_token(email, auth_token)
user = User.find(email: email)
session[:current_user] = user if user && Devise.secure_compare(user.auth_token, auth_token)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment