You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
758 B

  1. # frozen_string_literal: true
  2. class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
  3. skip_before_action :authenticate_resource_owner!
  4. before_action :store_current_location
  5. before_action :authenticate_resource_owner!
  6. before_action :require_not_suspended!, only: :destroy
  7. before_action :set_body_classes
  8. skip_before_action :require_functional!
  9. include Localized
  10. def destroy
  11. Web::PushSubscription.unsubscribe_for(params[:id], current_resource_owner)
  12. super
  13. end
  14. private
  15. def set_body_classes
  16. @body_classes = 'admin'
  17. end
  18. def store_current_location
  19. store_location_for(:user, request.url)
  20. end
  21. def require_not_suspended!
  22. forbidden if current_account.suspended?
  23. end
  24. end