omniauth-naranya_id 0.0.7 → 0.0.8
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/lib/omniauth-naranya_id/version.rb +1 -1
- data/lib/omniauth/strategies/naranya_id.rb +20 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5320911842aaf50c3cfaf42a186b784ba4546af9
|
4
|
+
data.tar.gz: af8e77bff0ebcc8816d2a8f54a143f3026db8eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed351cb2d73d9fd6cc0b9eef553c8c9ded0e5210fc89414b50973fe3524ccfd5a7bd03e5d122cdfebec19f105408b275de01d20045ca75ed6e2cafbd55568bf7
|
7
|
+
data.tar.gz: e754d80586d1807490b1367b8c98ca7be1a1a574e308a399db0e5ea05cd82e99a946f81c100b12e52311fc6a2680e36b230b373c3c790c2f4c29d03e01dbff32
|
@@ -31,17 +31,12 @@ module OmniAuth
|
|
31
31
|
session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
|
32
32
|
|
33
33
|
# Setup de parametros de lang/locale:
|
34
|
-
|
35
|
-
|
36
|
-
{ lang: I18n.locale.to_s.split('-').first, locale: I18n.locale.to_s }
|
37
|
-
else
|
38
|
-
{}
|
39
|
-
end
|
40
|
-
|
34
|
+
authorize_params = options[:authorize_params].merge locale_params
|
35
|
+
|
41
36
|
if request_token.callback_confirmed?
|
42
|
-
redirect request_token.authorize_url
|
37
|
+
redirect request_token.authorize_url authorize_params
|
43
38
|
else
|
44
|
-
redirect request_token.authorize_url(
|
39
|
+
redirect request_token.authorize_url(authorize_params.merge(:oauth_callback => callback_url))
|
45
40
|
end
|
46
41
|
|
47
42
|
rescue ::Timeout::Error => e
|
@@ -106,11 +101,15 @@ module OmniAuth
|
|
106
101
|
|
107
102
|
private
|
108
103
|
|
109
|
-
def
|
110
|
-
|
111
|
-
request.params[:locale]
|
112
|
-
end
|
104
|
+
def locale_params
|
105
|
+
_loc_params = {}
|
113
106
|
|
107
|
+
params = request.params.with_indifferent_access
|
108
|
+
|
109
|
+
client_locale = if params[:locale].present?
|
110
|
+
params[:locale]
|
111
|
+
end
|
112
|
+
|
114
113
|
if client_locale.present?
|
115
114
|
# If the complete locale is not available, we'll use the language part of the client locale:
|
116
115
|
client_language = client_locale.split('-').first
|
@@ -118,13 +117,18 @@ module OmniAuth
|
|
118
117
|
# User the client_locale or the client_language, if the former is not available:
|
119
118
|
if defined?(I18n) && I18n.respond_to?(:locale_available?) && I18n.respond_to?(:locale)
|
120
119
|
if I18n.locale_available? client_locale
|
121
|
-
|
122
|
-
|
123
|
-
|
120
|
+
_loc_params[:locale] = client_locale
|
121
|
+
_loc_params[:lang] = client_language
|
122
|
+
OmniAuth.logger.debug "The client's locale '#{client_locale}' is available in the app, and will be sent to OAuth site"
|
123
|
+
else
|
124
|
+
OmniAuth.logger.debug "The client's locale '#{client_locale}' is not available in the app, and will not be sent to OAuth site"
|
124
125
|
end
|
125
126
|
end
|
127
|
+
|
126
128
|
end
|
127
129
|
|
130
|
+
_loc_params
|
131
|
+
|
128
132
|
end
|
129
133
|
|
130
134
|
end
|