Skip to content

Instantly share code, notes, and snippets.

@jmmastey
Created January 17, 2015 19:06
Show Gist options
  • Save jmmastey/906da4ebf1cb025d0697 to your computer and use it in GitHub Desktop.
Save jmmastey/906da4ebf1cb025d0697 to your computer and use it in GitHub Desktop.
def auth_by_token(email, auth_token)
user = User.find(email: email)
if user && Devise.secure_compare(user.auth_token, auth_token)
session[:current_user] = user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment