Create a gist now

Instantly share code, notes, and snippets.

class SessionsController < ApplicationController
def login
#Login Form
end
def login_attempt
authorized_user = User.authenticate(params[:username_or_email],params[:login_password])
if authorized_user
flash[:notice] = "Wow Welcome again, you logged in as #{authorized_user.username}"
redirect_to(:action => 'home')
else
flash[:notice] = "Invalid Username or Password"
flash[:color]= "invalid"
render "login"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment