sorcery icon indicating copy to clipboard operation
sorcery copied to clipboard

Flash messages disappear after unsuccessful login attempt

Open k-rudy opened this issue 11 years ago • 1 comments

Hi guys.

This issue is pretty important.

Steps to reproduce:

  1. In application that uses sorcery - Login with valid credentials Result: Flash notice is displayed - good.
  2. Logout
  3. Try to login with invalid credentials Result: Login errors are displayed on login page - good
  4. 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.

k-rudy avatar Apr 18 '14 08:04 k-rudy

Hi Konstantin,

thanks for your report, I'll have a look at this issue on the weekend and will get back to you then.

arnvald avatar Apr 18 '14 09:04 arnvald