omniauth-gitlab 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24e5db0951198ccfb5473ff5fe3a6a626b91edfe
4
- data.tar.gz: cb7f0598640a8c6a80245cbb6f5758e53670eef3
3
+ metadata.gz: 6c90ebc7ccce82e78ef6218157792adbf2a8be97
4
+ data.tar.gz: 78aa9a9c27a1b99fe18a70cc619547552af6b88c
5
5
  SHA512:
6
- metadata.gz: 2fe15159ccfe5f31ff1266b036aa3b4366623f1c669a69599fa710ac77679093377135aa75d77b8b4446a8dbfcf8635cf1ed7de8e30b561712a45354072bcc44
7
- data.tar.gz: 9611dc576bdba0613f62c452bdd4583d5c584c428395062bd732ffe9ea1833a401623daa15c444420f8a9f757391b58a2546ec7da3ba6cce473bb6e7442a07a5
6
+ metadata.gz: 46f9f7128e336fb1f6c11050982378c633ef5a2702db33f8d8acaed89669b85d6d40ce39c9ba525840ed9a6918c20a44c0ed04d54dfe169fe82ebc8995ba83e8
7
+ data.tar.gz: f9712c2a6af44bd34cfc20abb593576acf05aaa2f2aa646536fd034267e2acb872235811376d3cad91669f9caa255f6abda976b2010c2c49ef43b060f752b2b5
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Gitlab
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
@@ -11,6 +11,8 @@ module OmniAuth
11
11
  token_url: '/oauth/token'
12
12
  }
13
13
 
14
+ option :redirect_url
15
+
14
16
  uid { raw_info['id'].to_s }
15
17
 
16
18
  info do
@@ -29,6 +31,12 @@ module OmniAuth
29
31
  def raw_info
30
32
  @raw_info ||= access_token.get('/api/v3/user').parsed
31
33
  end
34
+
35
+ private
36
+
37
+ def callback_url
38
+ options.redirect_url || (full_host + script_name + callback_path)
39
+ end
32
40
  end
33
41
  end
34
42
  end
@@ -17,7 +17,8 @@ describe OmniAuth::Strategies::GitLab do
17
17
  site: enterprise_site,
18
18
  authorize_url: enterprise_authorize_url,
19
19
  token_url: enterprise_token_url
20
- }
20
+ },
21
+ redirect_url: 'http://localhost:9292/callback_url'
21
22
  )
22
23
  end
23
24
 
@@ -45,6 +46,18 @@ describe OmniAuth::Strategies::GitLab do
45
46
  end
46
47
  end
47
48
 
49
+ describe 'redirect_url' do
50
+ context 'with defaults' do
51
+ subject { gitlab_service.options }
52
+ its(:redirect_url) { is_expected.to be_nil }
53
+ end
54
+
55
+ context 'with customs' do
56
+ subject { enterprise.options }
57
+ its(:redirect_url) { is_expected.to eq 'http://localhost:9292/callback_url' }
58
+ end
59
+ end
60
+
48
61
  describe '#raw_info' do
49
62
  it 'sent request to current user endpoint' do
50
63
  expect(access_token).to receive(:get).with('/api/v3/user').and_return(response)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ssein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-18 00:00:00.000000000 Z
11
+ date: 2016-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth