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



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

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

Instance Method Details

#approve!Object



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

def approve!
  @approval = true
end

#approved?Boolean



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

def approved?
  @approval
end

#finishObject



104
105
106
107
108
109
110
# File 'lib/rack/oauth2/server/authorize.rb', line 104

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

#protocol_paramsObject



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

def protocol_params
  {state: state}
end

#redirect_uri_with_credentialsObject



100
101
102
# File 'lib/rack/oauth2/server/authorize.rb', line 100

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