Module: Rack::OAuth2::Server::Authorize::ErrorHandler

Included in:
BadRequest, ServerError, TemporarilyUnavailable
Defined in:
lib/rack/oauth2/server/authorize/error.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
# File 'lib/rack/oauth2/server/authorize/error.rb', line 6

def self.included(klass)
  klass.send :attr_accessor, :redirect_uri, :state, :protocol_params_location
end

Instance Method Details

#finishObject



19
20
21
22
23
24
25
26
27
# File 'lib/rack/oauth2/server/authorize/error.rb', line 19

def finish
  if redirect?
    super do |response|
      response.redirect Util.redirect_uri(redirect_uri, protocol_params_location, protocol_params)
    end
  else
    raise self
  end
end

#protocol_paramsObject



10
11
12
# File 'lib/rack/oauth2/server/authorize/error.rb', line 10

def protocol_params
  super.merge(state: state)
end

#redirect?Boolean

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/rack/oauth2/server/authorize/error.rb', line 14

def redirect?
  redirect_uri.present? &&
  protocol_params_location.present?
end