Created
January 17, 2015 19:06
-
-
Save jmmastey/906da4ebf1cb025d0697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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