omniauth-spotify 0.0.11 → 0.0.13

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: 7b52e324f0a69229ce9d430055f440b5f86a69a3
4
- data.tar.gz: 5c8f140624660c6af633a4e14f4f844e2fdc0170
3
+ metadata.gz: c6cfc7bc3f3960d5aafb19072df330b9fc114144
4
+ data.tar.gz: c47393c874d66fd154ced25e43c3fbf3f26c6ddc
5
5
  SHA512:
6
- metadata.gz: 1a4146f276e7678cf06522c51ff7a947abb220afc0c1853c09380c9b05564f014a4a4aa4cadf79c334cf93cfd6965d2848b19d0d176987a51ac2cc069c6a5da8
7
- data.tar.gz: 2caa8f99d2a67d023283f3d359bd2ead3ca0e97b2fc6ae3b8c763973b9b26b1eb649a4a01ee1f89c11554da3845ceaeed194619d293f1e1c6b575bc441207f4b
6
+ metadata.gz: e1bacddc1f7689409a152dec14a07d92886a97e1175fb1151241361f767309ad0ce2410dffcdc02b11f24fa4d561d5a94b128f922f9e458749ef40cc4349c57a
7
+ data.tar.gz: 86a327b610d67113878c57e9afc4897555c3bcc3764564c14a111935ca3308036196b96f57eaa41a577ea61a0f4f23ab97edbacde45e93f9055208d271bbe937
data/README.md CHANGED
@@ -51,6 +51,11 @@ To force a permission dialog being shown to the user, which also makes it possib
51
51
  set either `request.env['rack.session'][:ommiauth_spotify_force_approval?]` or `flash[:ommiauth_spotify_force_approval?]` (Rails apps only)
52
52
  to a truthy value on the request that performs the Omniauth redirection.
53
53
 
54
+ Alternately, you can pass `show_dialog=true` when you redirect to your spotify auth URL if you prefer not to use the session.
55
+ ```
56
+ http://localhost:3000/auth/spotify?show_dialog=true
57
+ ```
58
+
54
59
  ## Auth Hash Schema
55
60
 
56
61
  * Authorization data is available in the `request.env['omniauth.auth'].credentials` -- a hash that also responds to
@@ -61,7 +61,21 @@ module OmniAuth
61
61
  end
62
62
 
63
63
  def authorize_params
64
- super.tap { |params| params[:show_dialog] = true if session.delete(FORCE_APPROVAL_KEY) || defined?(Rails) && session[:flash]['flashes'][FORCE_APPROVAL_KEY] }
64
+ super.tap do |params|
65
+ if session.delete(FORCE_APPROVAL_KEY) ||
66
+ (session[:flash] && session[:flash]['flashes'] && session[:flash]['flashes'][FORCE_APPROVAL_KEY])
67
+ params[:show_dialog] = true
68
+ end
69
+ end
70
+ end
71
+
72
+ def request_phase
73
+ %w[show_dialog].each do |v|
74
+ if request.params[v]
75
+ options[:authorize_params][v.to_sym] = request.params[v]
76
+ end
77
+ end
78
+ super
65
79
  end
66
80
 
67
81
  def callback_url
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Spotify
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-spotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 2.6.8
63
+ rubygems_version: 2.6.11
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: OmniAuth strategy for Spotify