Weird ever loop question

Hi, folks,
    I've run into a weird problem when I was trying to implement an
authentication system myself, here is the adminController code,

class AdminController < ApplicationController
  before_filter :check_authentication, :except =>
[:signin_form, :signin]

  def index

  def signin_form

  def signin
    session[:user] = User.authenticate(params[:username],
    redirect_to :action=>session[:intended_action]

  def check_authentication
    unless session[:user]
      session[:intended_action] = action_name
      redirect_to :action=>"singin_form"

I restart my webrick server and I typed http://localhost:3000/admin,
it should go to signin_form.rhtml to ask me sign in, but what happned
is ever loop sending request to signin_form, any informative tips will
be appreciated.

All the best,
Liu Hao

Hello Liu:

Firstly, I wouldn't implement an authentication system your self as
there are plenty of good plugins out there for that. Try checking out


Secondly, there are a couple of issues with the code in the
check_authentication method:

      session[:intended_action] = action_name # where is action_name
being set/coming from?
      redirect_to :action=>"singin_form" Your redirect action is
incorrrect - should be signin_form