File: token.rb

package info (click to toggle)
ruby-rack-oauth2 2.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 560 kB
  • sloc: ruby: 4,013; makefile: 4
file content (43 lines) | stat: -rw-r--r-- 960 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module Rack
  module OAuth2
    module Server
      class Authorize
        class Token < Abstract::Handler
          def _call(env)
            @request  = Request.new env
            @response = Response.new request
            super
          end

          class Request < Authorize::Request
            def initialize(env)
              super
              @response_type = :token
              attr_missing!
            end

            def error_params_location
              :fragment
            end
          end

          class Response < Authorize::Response
            attr_required :access_token

            def protocol_params
              super.merge(
                access_token.token_response.delete_if do |k, v|
                  k == :refresh_token
                end
              )
            end

            def protocol_params_location
              :fragment
            end
          end
        end
      end
    end
  end
end