sorcery
sorcery copied to clipboard
Flash messages disappear after unsuccessful login attempt
Hi guys.
This issue is pretty important.
Steps to reproduce:
- In application that uses sorcery - Login with valid credentials Result: Flash notice is displayed - good.
- Logout
- Try to login with invalid credentials Result: Login errors are displayed on login page - good
- Login the user with valid credentials Result: No flash messages are displayed - BUG
I tried to reproduce the issue on https://github.com/NoamB/sorcery-example-app and see the same issue there.
UserSessionContraller action looks like that:
def create
respond_to do |format|
if @user = login(params[:email],params[:password],params[:remember])
format.html { redirect_back_or_to(:users, :notice => 'Login successfull.') }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { flash.now[:alert] = "Login failed."; render :action => "new" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
Thanks, Konstantin.
Hi Konstantin,
thanks for your report, I'll have a look at this issue on the weekend and will get back to you then.