Module: Opro::Controllers::Concerns::ErrorMessages
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationControllerHelper
- Defined in:
- lib/opro/controllers/concerns/error_messages.rb
Instance Method Summary collapse
- #generate_oauth_error_message! ⇒ Object
- #generate_oauth_permissions_error_message!(msg = '') ⇒ Object
Instance Method Details
#generate_oauth_error_message! ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/opro/controllers/concerns/error_messages.rb', line 4 def msg = "" msg << ' - No OAuth token provided!' if oauth_access_token.blank? msg << ' - `Allow OAuth` is set to false!' if allow_oauth? == false msg << ' - OAuth user not found!' if oauth_user.blank? msg << ' - OAuth client has been rate limited' if oauth_client_over_rate_limit? msg = (msg) msg end |
#generate_oauth_permissions_error_message!(msg = '') ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/opro/controllers/concerns/error_messages.rb', line 14 def (msg = '') if ! msg << ' - OAuth client not permitted' .each do || msg << "- #{} permission required" unless () end end msg end |