sinatra-google-auth 0.0.4 → 0.0.5

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.
data/README.md CHANGED
@@ -50,6 +50,25 @@ class App < Sinatra::Base
50
50
  end
51
51
  ```
52
52
 
53
+ ## Doing something with the User
54
+
55
+ Define an `on_user` method in your app to do something with the user info after authentication.
56
+
57
+ ```ruby
58
+ class App < Sinatra::Base
59
+ register Sinatra::GoogleAuth
60
+
61
+ def on_user(info)
62
+ puts info.inspect
63
+ end
64
+
65
+ get '*' do
66
+ authenticate
67
+ 'hello'
68
+ end
69
+ end
70
+ ```
71
+
53
72
  ## Configuration
54
73
 
55
74
  ### Google Endpoint
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module GoogleAuth
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
@@ -13,6 +13,7 @@ module Sinatra
13
13
  def handle_authentication_callback
14
14
  unless session["user"]
15
15
  user_info = request.env["omniauth.auth"].info
16
+ on_user(user_info) if respond_to? :on_user
16
17
  session["user"] = Array(user_info.email).first.downcase
17
18
  end
18
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-google-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-12 00:00:00.000000000Z
12
+ date: 2012-04-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-openid
16
- requirement: &70278697564720 !ruby/object:Gem::Requirement
16
+ requirement: &70220182353020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70278697564720
24
+ version_requirements: *70220182353020
25
25
  description: Drop-in google auth for sinatra apps
26
26
  email:
27
27
  - christopher.continanza@gmail.com