I have a standard type authentication technique direct from AWDWR, so
there is a
before_filter :authorize_employee, :except => :login in my
the authorize_employee is in application.rb
def authorize_employee unless session[:employee_id] flash[:notice] = "Please log in" # save the URL the user requested so we can hop back to it # after login session[:jumpto] = request.parameters redirect_to(:controller => "employees", :action => "login") else logger.info "User already authorized as
All standard stuff and works as expected most of the time.
Now the problem is that if the session expires and someone clicks on say
the Create New
link in the ajax-scaffold (of a page that was already sitting there from
last time), I
get the redirect_to :controller => ‘employees’, :action => ‘login’, but
form gets inserted into the existing page as if it were a response from
an ajax request,
but a redirect_to is not generating an ajax request and I expect a new
page to be
generated with the login form.
I have been playing with this for hours now, and cannot figure out how
to get it to put
up a fresh login screen.
Any ideas anyone?