omniauth-naranya_id 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/naranya_id.rb +24 -0
- data/lib/omniauth-naranya_id/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba256048e9c8b966cc79af434fc0d5397ff5ab18
|
4
|
+
data.tar.gz: 34a0e867a161f76d21be126eee7f2bda3644091e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc946786f9db73d9b69d459cf00663abc4c56310717aea0a657bd8101c5d7fdac5c3712b74fe7a8039f5fa85ff72b61bbeac7f59176ec84f50a33a510af180aa
|
7
|
+
data.tar.gz: 20ba6eea2a612917b7d0fe52e4b83aa074a48028e071b51cf245964b02452660f8191456a12ffc97f5660f02183de42372ee6e94c7ff9a62be46ff1f86c3eadd
|
@@ -31,6 +31,7 @@ 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
|
+
set_locale
|
34
35
|
locale_params = if defined?(I18n) && I18n.respond_to?(:locale) && I18n.locale.present?
|
35
36
|
{ lang: I18n.locale.to_s.split('-').first, locale: I18n.locale.to_s }
|
36
37
|
else
|
@@ -103,6 +104,29 @@ module OmniAuth
|
|
103
104
|
end
|
104
105
|
end
|
105
106
|
|
107
|
+
private
|
108
|
+
|
109
|
+
def set_locale
|
110
|
+
client_locale = if request.params[:locale].present?
|
111
|
+
request.params[:locale]
|
112
|
+
end
|
113
|
+
|
114
|
+
if client_locale.present?
|
115
|
+
# If the complete locale is not available, we'll use the language part of the client locale:
|
116
|
+
client_language = client_locale.split('-').first
|
117
|
+
|
118
|
+
# User the client_locale or the client_language, if the former is not available:
|
119
|
+
if defined?(I18n) && I18n.respond_to?(:locale_available?) && I18n.respond_to?(:locale)
|
120
|
+
if I18n.locale_available? client_locale
|
121
|
+
I18n.locale = client_locale
|
122
|
+
elsif I18n.locale_available? client_language
|
123
|
+
I18n.locale = client_language
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
106
130
|
end
|
107
131
|
end
|
108
132
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-naranya_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Quintanilla
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|