ruby_native 0.2.1 → 0.2.2
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/ruby_native/oauth_middleware.rb +9 -0
- data/lib/ruby_native/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e3d9d2d2971b99d4c25141ff38a61f0ad65473c968b288501e6a37b57468320
|
|
4
|
+
data.tar.gz: c5f615b0d53f72c92dc2b93414c8329eafb6b2d3f358283b7b351091df3f723e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87fcfe5b175f4e858798ed6633f697d30910d11137805a0c8c7e72e3954c1ab3201411e91eac131f5d43a5d0f1dbafea4d94c2d9eb0ae059e2281736f76a4231
|
|
7
|
+
data.tar.gz: a0fad64e8c484e5b146d23db3735fdf863352daaf80fba366fb3b43528d3f987336ad67ec925bdd8057a27250eeb8f20fd1cf82fc51ae3aead2c10d5e7fceba9
|
|
@@ -150,6 +150,8 @@ module RubyNative
|
|
|
150
150
|
else []
|
|
151
151
|
end
|
|
152
152
|
|
|
153
|
+
redirect_url = "/" if auth_start_path?(redirect_url)
|
|
154
|
+
|
|
153
155
|
Rails.logger.info { "[RubyNative] Captured #{cookies.size} cookies for token (raw type: #{raw_cookies.class})" }
|
|
154
156
|
|
|
155
157
|
self.class.build_token(cookies: cookies, redirect_url: redirect_url)
|
|
@@ -160,6 +162,13 @@ module RubyNative
|
|
|
160
162
|
[302, {"location" => "#{callback_scheme}://auth/callback?#{query}"}, [""]]
|
|
161
163
|
end
|
|
162
164
|
|
|
165
|
+
def auth_start_path?(url)
|
|
166
|
+
path = URI.parse(url).path
|
|
167
|
+
path&.start_with?("/native/auth/start")
|
|
168
|
+
rescue URI::InvalidURIError
|
|
169
|
+
false
|
|
170
|
+
end
|
|
171
|
+
|
|
163
172
|
def oauth_paths
|
|
164
173
|
RubyNative.config&.dig(:auth, :oauth_paths) || []
|
|
165
174
|
end
|
data/lib/ruby_native/version.rb
CHANGED