Class: Doorkeeper::Request::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/doorkeeper/request/token.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pre_auth, server) ⇒ Token

Returns a new instance of Token.



11
12
13
# File 'lib/doorkeeper/request/token.rb', line 11

def initialize(pre_auth, server)
  @pre_auth, @server = pre_auth, server
end

Instance Attribute Details

#pre_authObject

Returns the value of attribute pre_auth.



9
10
11
# File 'lib/doorkeeper/request/token.rb', line 9

def pre_auth
  @pre_auth
end

#serverObject

Returns the value of attribute server.



9
10
11
# File 'lib/doorkeeper/request/token.rb', line 9

def server
  @server
end

Class Method Details

.build(server) ⇒ Object

TODO: this is so wrong!



5
6
7
# File 'lib/doorkeeper/request/token.rb', line 5

def self.build(server)
  new(server.context.send(:pre_auth), server)
end

Instance Method Details

#authorizeObject



19
20
21
# File 'lib/doorkeeper/request/token.rb', line 19

def authorize
  request.authorize
end

#requestObject



15
16
17
# File 'lib/doorkeeper/request/token.rb', line 15

def request
  @request ||= OAuth::TokenRequest.new(pre_auth, server.current_resource_owner)
end