Use store_location in Unauthorized handler

openid
Marcin Kulik 13 years ago
parent a0041abed1
commit 8216781067

@ -52,6 +52,7 @@ class ApplicationController < ActionController::Base
if request.xhr?
render :json => "Unauthorized", :status => 401
else
store_location
redirect_to login_path, :notice => "Please login"
end
end

@ -43,6 +43,8 @@ describe FakeController do
context "when typical request" do
it "redirects to login_path" do
@controller.should_receive(:store_location)
get :foo
flash[:notice].should == "Please login"

Loading…
Cancel
Save