class Doorkeeper::OAuth::CodeResponse

Attributes

auth[RW]
pre_auth[RW]
response_on_fragment[RW]

Public Class Methods

new(pre_auth, auth, options = {}) click to toggle source
# File lib/doorkeeper/oauth/code_response.rb, line 8
def initialize(pre_auth, auth, options = {})
  @pre_auth = pre_auth
  @auth = auth
  @response_on_fragment = options[:response_on_fragment]
end

Public Instance Methods

redirect_uri() click to toggle source
# File lib/doorkeeper/oauth/code_response.rb, line 18
def redirect_uri
  if URIChecker.native_uri? pre_auth.redirect_uri
    auth.native_redirect
  elsif response_on_fragment
    Authorization::URIBuilder.uri_with_fragment(
      pre_auth.redirect_uri,
      access_token: auth.token.token,
      token_type: auth.token.token_type,
      expires_in: auth.token.expires_in_seconds,
      state: pre_auth.state
    )
  else
    Authorization::URIBuilder.uri_with_query(
      pre_auth.redirect_uri,
      code: auth.token.token,
      state: pre_auth.state
    )
  end
end
redirectable?() click to toggle source
# File lib/doorkeeper/oauth/code_response.rb, line 14
def redirectable?
  true
end