The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

36 rivejä
861 B

  1. # frozen_string_literal: true
  2. class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
  3. skip_before_action :authenticate_resource_owner!
  4. before_action :store_current_location
  5. before_action :authenticate_resource_owner!
  6. before_action :set_cache_headers
  7. include Localized
  8. private
  9. def store_current_location
  10. store_location_for(:user, request.url)
  11. end
  12. def render_success
  13. if skip_authorization? || (matching_token? && !truthy_param?('force_login'))
  14. redirect_or_render authorize_response
  15. elsif Doorkeeper.configuration.api_only
  16. render json: pre_auth
  17. else
  18. render :new
  19. end
  20. end
  21. def truthy_param?(key)
  22. ActiveModel::Type::Boolean.new.cast(params[key])
  23. end
  24. def set_cache_headers
  25. response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
  26. end
  27. end