omniauth-spotify 0.0.3 → 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.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/lib/omniauth-spotify.rb +15 -2
- data/lib/omniauth-spotify/version.rb +1 -1
- data/omniauth-spotify.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92fcbd43deb2d092e6869684c3e22d49dfc0b0c6
|
4
|
+
data.tar.gz: 17b662e1772165306566e144511d8a0874d5ddc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 920ea8dd25fc9ebd6c59a15b7ea2b3ecb8646d271fcb8a5cf03119a025afff2ebaa5964cade094d2a2235f6b0c3492985b80aa4742bd523df6b08def30e81985
|
7
|
+
data.tar.gz: f82d9246935d1a2e092b7d613cde46c3156aadd6559b9933954196729af3755f9e6203e911a5bc3cd0ee34364222b671dfd6a0e2bfef9915a14dff83ef5207e4
|
data/README.md
CHANGED
@@ -42,13 +42,24 @@ config.omniauth :spotify, 'app_id', 'app_secret', scope: 'playlist-read-private
|
|
42
42
|
|
43
43
|
Here's an example auth hash, available in `request.env['omniauth.auth']`:
|
44
44
|
|
45
|
+
Some of this fields depend on what scopes you ask, namely
|
46
|
+
|
47
|
+
* `user-read-email` affects the presence of the `email` field
|
48
|
+
* `user-read-private` affects the value of `name` (if the scope is
|
49
|
+
missing it will reflect `username`) and the presence of
|
50
|
+
`image`
|
51
|
+
|
45
52
|
```ruby
|
46
53
|
{
|
47
54
|
:provider => "spotify",
|
48
55
|
:uid => "1111111111",
|
49
56
|
:info => {
|
50
57
|
:name => "Claudio Poli",
|
51
|
-
:
|
58
|
+
:nickname => 'SomeName',
|
59
|
+
:email => "claudio@icorete.ch",
|
60
|
+
:urls => {:spotify => "https://open.spotify.com/user/1111111111"},
|
61
|
+
:image => 'https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/t1.0-1/s320x320/301234_1962753760624_625151598_n.jpg'
|
62
|
+
|
52
63
|
},
|
53
64
|
:credentials => {
|
54
65
|
:token => "xxxx",
|
data/lib/omniauth-spotify.rb
CHANGED
@@ -23,8 +23,13 @@ module OmniAuth
|
|
23
23
|
|
24
24
|
info do
|
25
25
|
{
|
26
|
-
|
27
|
-
|
26
|
+
# display_name may be empty if user does not request
|
27
|
+
# 'user-read-private'
|
28
|
+
:name => raw_info['display_name'] || raw_info['id'],
|
29
|
+
:nickname => raw_info['id'],
|
30
|
+
:email => raw_info['email'],
|
31
|
+
:urls => raw_info['external_urls'],
|
32
|
+
:image => image_url
|
28
33
|
}
|
29
34
|
end
|
30
35
|
|
@@ -34,6 +39,14 @@ module OmniAuth
|
|
34
39
|
}
|
35
40
|
end
|
36
41
|
|
42
|
+
def image_url
|
43
|
+
if images = raw_info['images']
|
44
|
+
if first = images.first
|
45
|
+
first['url']
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
37
50
|
def raw_info
|
38
51
|
@raw_info ||= access_token.get('me').parsed
|
39
52
|
end
|
data/omniauth-spotify.gemspec
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-spotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Poli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: omniauth
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: omniauth-oauth2
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|