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
end
def signin_form
end
def signin
session[:user] = User.authenticate(params[:username],
params[:password]).id
redirect_to :action=>session[:intended_action]
end
def check_authentication
unless session[:user]
session[:intended_action] = action_name
redirect_to :action=>“singin_form”
end
end
end
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