so I have this project in RoR where I use sorcery gem for register and login,
my regiter is working good, I see the data inside database is added, but when I try to login using the same data it somehow doesnt recognize the data.
this is the function I am using from a tutorial for login.
def logins
user = login(params[:username], params[:password], params[:remember_me])
if user
redirect_back_or_to root_url, :notice => "Logged in!"
else
flash.now.alert = "Email or password was invalid"
render :new
end
end
I am sure I entered the username and password correctly, but still it always shows email or password is invalid.
Any suggestions would be appreciated, because I’m out of ideas :(.
May be you post to “logins” action :email instead of :username option in params? Check your logs of request.