Class: Rack::OAuth2::Server::Authorize::Response

Inherits:
Rack::OAuth2::Server::Abstract::Response show all
Defined in:
lib/rack/oauth2/server/authorize.rb

Direct Known Subclasses

Code::Response, Token::Response

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ Response

Returns a new instance of Response.



80
81
82
83
# File 'lib/rack/oauth2/server/authorize.rb', line 80

def initialize(request)
  @state = request.state
  super
end

Instance Method Details

#approve!Object



89
90
91
# File 'lib/rack/oauth2/server/authorize.rb', line 89

def approve!
  @approval = true
end

#approved?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/rack/oauth2/server/authorize.rb', line 85

def approved?
  @approval
end

#finishObject



101
102
103
104
105
106
107
# File 'lib/rack/oauth2/server/authorize.rb', line 101

def finish
  if approved?
    attr_missing!
    redirect redirect_uri_with_credentials
  end
  super
end

#protocol_paramsObject



93
94
95
# File 'lib/rack/oauth2/server/authorize.rb', line 93

def protocol_params
  {:state => state}
end

#redirect_uri_with_credentialsObject



97
98
99
# File 'lib/rack/oauth2/server/authorize.rb', line 97

def redirect_uri_with_credentials
  Util.redirect_uri(redirect_uri, protocol_params_location, protocol_params)
end