omniauth-mailru 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  *.swo
3
3
  Gemfile.lock
4
4
  coverage
5
+ *.gem
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OmniAuth Mail.ru
2
2
 
3
- This gem contains the unofficial Mail.ru OAuth2 strategy for OmniAuth.
3
+ This gem contains the unofficial Mail.ru OAuth2 strategy for [OmniAuth](http://github.com/intridea/omniauth).
4
4
 
5
5
  [![Build Status](https://secure.travis-ci.org/gumayunov/omniauth-mailru.png)](http://travis-ci.org/gumayunov/omniauth-mailru)
6
6
 
@@ -10,6 +10,20 @@ This gem contains the unofficial Mail.ru OAuth2 strategy for OmniAuth.
10
10
  provider :mailru, ENV['MAILRU_KEY'], ENV['MAILRU_PRIVATE_KEY']
11
11
  end
12
12
 
13
+ Callback url can be passed in order to match specified one on Mail.ru side in application preferences.
14
+
15
+ use OmniAuth::Builder do
16
+ provider :mailru, ENV['MAILRU_KEY'], ENV['MAILRU_PRIVATE_KEY'], {
17
+ :authorize_options => {
18
+ :callback_url => ENV['MAILRU_CALLBACK_URL']
19
+ }
20
+ }
21
+ end
22
+
23
+ ## Links
24
+
25
+ * http://api.mail.ru/docs/guides/oauth/
26
+
13
27
  ## License
14
28
 
15
29
  Copyright (c) 2011 by Victor Gumayunov
@@ -33,7 +33,12 @@ end
33
33
  use Rack::Session::Cookie
34
34
 
35
35
  use OmniAuth::Builder do
36
- provider :mailru, ENV['MAILRU_KEY'], ENV['MAILRU_PRIVATE']
36
+ provider :mailru, ENV['MAILRU_KEY'], ENV['MAILRU_PRIVATE_KEY'], {
37
+ :authorize_options => {
38
+ # optional
39
+ :callback_url => ENV['MAILRU_CALLBACK_URL']
40
+ }
41
+ }
37
42
  end
38
43
 
39
44
  run App.new
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Mailru
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -35,6 +35,10 @@ module OmniAuth
35
35
  {:raw_info => raw_info}
36
36
  end
37
37
 
38
+ def callback_url
39
+ options.authorize_options.callback_url || super
40
+ end
41
+
38
42
  private
39
43
 
40
44
  def raw_info
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-mailru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
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: 2011-11-15 00:00:00.000000000Z
12
+ date: 2011-11-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &70142864223120 !ruby/object:Gem::Requirement
16
+ requirement: &70194358632220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70142864223120
24
+ version_requirements: *70194358632220
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth-oauth2
27
- requirement: &70142864221740 !ruby/object:Gem::Requirement
27
+ requirement: &70194358631380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '1.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70142864221740
35
+ version_requirements: *70194358631380
36
36
  description: OmniAuth strategy for Mail.ru
37
37
  email:
38
38
  - gumayunov@gmail.com