rack-oauth2-server 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,11 +5,11 @@ class MyApp < Sinatra::Base
5
5
  set :sessions, true
6
6
 
7
7
  register Rack::OAuth2::Sinatra
8
- oauth[:scopes] = %w{read write}
9
- oauth[:authenticator] = lambda do |username, password|
8
+ oauth.scopes = %w{read write}
9
+ oauth.authenticator = lambda do |username, password|
10
10
  "Superman" if username == "cowbell" && password == "more"
11
11
  end
12
- oauth[:database] = DATABASE
12
+ oauth.database = DATABASE
13
13
 
14
14
 
15
15
  # 3. Obtaining End-User Authorization
@@ -30,11 +30,11 @@ class MyApp < Sinatra::Base
30
30
 
31
31
  # 5. Accessing a Protected Resource
32
32
 
33
- before { @user = oauth.resource if oauth.authenticated? }
33
+ before { @user = oauth.identity if oauth.authenticated? }
34
34
 
35
35
  get "/public" do
36
36
  if oauth.authenticated?
37
- "HAI from #{oauth.resource}"
37
+ "HAI from #{oauth.identity}"
38
38
  else
39
39
  "HAI"
40
40
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-oauth2-server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 0
10
- version: 1.0.0
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Assaf Arkin
@@ -108,7 +108,7 @@ licenses: []
108
108
  post_install_message: ""
109
109
  rdoc_options:
110
110
  - --title
111
- - rack-oauth2-server 1.0.0
111
+ - rack-oauth2-server 1.1.0
112
112
  - --main
113
113
  - README.rdoc
114
114
  - --webcvs