handle unauthorized with baaaaad 403

This commit is contained in:
Devin Howard 2016-03-11 21:35:48 +08:00
parent 73b82801cc
commit 7395811ba5

View file

@ -1,5 +1,6 @@
class ApplicationController < ActionController::Base
include Pundit
rescue_from Pundit::NotAuthorizedError, with: :handle_unauthorized
protect_from_forgery
before_action :get_invite_link
@ -23,6 +24,10 @@ class ApplicationController < ActionController::Base
stored_location_for(resource) || request.referer || root_path
end
end
def handle_unauthorized
head :forbidden # TODO make this better
end
private