handle unauthorized with baaaaad 403
This commit is contained in:
parent
73b82801cc
commit
7395811ba5
1 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include Pundit
|
include Pundit
|
||||||
|
rescue_from Pundit::NotAuthorizedError, with: :handle_unauthorized
|
||||||
protect_from_forgery
|
protect_from_forgery
|
||||||
|
|
||||||
before_action :get_invite_link
|
before_action :get_invite_link
|
||||||
|
@ -23,6 +24,10 @@ class ApplicationController < ActionController::Base
|
||||||
stored_location_for(resource) || request.referer || root_path
|
stored_location_for(resource) || request.referer || root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handle_unauthorized
|
||||||
|
head :forbidden # TODO make this better
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue