Created
June 9, 2016 19:33
-
-
Save tylerjohnst/b048ec0d7b9eda617d4d8aea77b1886f to your computer and use it in GitHub Desktop.
This file contains 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 create | |
@user = User.find_by_email params[:email] | |
if @user && @user.valid_password?(password) | |
return redirect_to_oauth_complete(@user.account) if oauth_session? | |
sign_in @user | |
redirect_to [:dashboard] | |
else | |
flash[:error] = 'You have entered an invalid email or password. Please try again.' | |
render :new | |
flash.clear | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment