omniauth 2.4.0 → 2.4.1
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 +5 -4
- data/lib/omniauth/strategy/sign_ins.rb +11 -1
- data/lib/omniauth/version.rb +1 -1
- data/sig/omniauth.rbs +2 -0
- 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: b7036401ab6a24195d5ff7d7ac8f114afcb314cd0b3685d6fbfddcd424e4b077
|
|
4
|
+
data.tar.gz: 50e616b975bee533a46b2a4a81ec15cb83dbfc72cc8d3e3f2dfb9bf48301c95a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f391a82e4ca6ae19f91ee32f14421d9ac55a84d0f524561c52d52045ab162b64b8e6454745a5881b68fff7db6324e20abaa7cac498f28d94b512dc8762d0fbe
|
|
7
|
+
data.tar.gz: e00fd21d830f23003aad6e804dab073340a9fdc9ad8ded15880e3057ab73c0db3fa5a00b549f7c0e0b282c0b393112d4fe01f11ffb20e7b59de6fc426fc1a66a
|
data/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
[coveralls]: https://coveralls.io/r/omniauth/omniauth
|
|
17
17
|
|
|
18
18
|
This is the documentation for the in-development branch of OmniAuth.
|
|
19
|
-
You can find the documentation for the latest stable release [here](https://github.com/omniauth/omniauth/tree/v2.4.
|
|
19
|
+
You can find the documentation for the latest stable release [here](https://github.com/omniauth/omniauth/tree/v2.4.1)
|
|
20
20
|
|
|
21
21
|
## An Introduction
|
|
22
22
|
OmniAuth is a library that standardizes multi-provider authentication for
|
|
@@ -381,9 +381,10 @@ end
|
|
|
381
381
|
|
|
382
382
|
OmniAuth then stores the origin and params of the latest 3 sign-ins under
|
|
383
383
|
their keys in `session['omniauth.sign_ins']`, and gives each callback its
|
|
384
|
-
own.
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
own. The origin moves from `omniauth.origin` into the sign-in, so an
|
|
385
|
+
abandoned sign-in's origin never reaches the next one. `omniauth.params`
|
|
386
|
+
still holds the latest sign-in's params, and a callback whose key isn't
|
|
387
|
+
remembered gets those, and no origin.
|
|
387
388
|
|
|
388
389
|
The session is often a 4 KB cookie, so each sign-in stores only what it
|
|
389
390
|
needs: no origin when there isn't one, no params when they're empty, and
|
|
@@ -25,6 +25,11 @@ module OmniAuth
|
|
|
25
25
|
# size, and a few large ones would overflow a cookie session.
|
|
26
26
|
MAX_REMEMBERED_PARAMS_BYTESIZE = 512
|
|
27
27
|
|
|
28
|
+
# The session key of the request phase's origin, frozen so moving it
|
|
29
|
+
# doesn't make a new string in every request phase: unlike
|
|
30
|
+
# session[...], delete has no fast path for a string literal.
|
|
31
|
+
ORIGIN_KEY = 'omniauth.origin'.freeze
|
|
32
|
+
|
|
28
33
|
# Remembers the current request phase's sign-in under key, which the
|
|
29
34
|
# provider sends back to the callback: the strategy's own data, plus
|
|
30
35
|
# the origin and params OmniAuth stored, under "origin" and "params",
|
|
@@ -82,8 +87,13 @@ module OmniAuth
|
|
|
82
87
|
# Adds the origin and params stored for the current request phase to
|
|
83
88
|
# sign_in, leaving out an empty origin, empty params, and params too
|
|
84
89
|
# large to keep.
|
|
90
|
+
#
|
|
91
|
+
# The origin moves out of omniauth.origin into the sign-in. Otherwise,
|
|
92
|
+
# if this sign-in were abandoned, the next one would get its origin
|
|
93
|
+
# whenever it has no origin param or referer of its own. So a second
|
|
94
|
+
# sign-in remembered in the same request phase gets no origin.
|
|
85
95
|
def add_origin_and_params(sign_in)
|
|
86
|
-
origin = session
|
|
96
|
+
origin = session.delete(ORIGIN_KEY)
|
|
87
97
|
params = session['omniauth.params']
|
|
88
98
|
sign_in['origin'] = origin unless origin.nil? || origin.empty?
|
|
89
99
|
sign_in['params'] = params if params && !params.empty? && params_small_enough?(params)
|
data/lib/omniauth/version.rb
CHANGED
data/sig/omniauth.rbs
CHANGED
|
@@ -465,6 +465,8 @@ module OmniAuth
|
|
|
465
465
|
|
|
466
466
|
MAX_REMEMBERED_PARAMS_BYTESIZE: Integer
|
|
467
467
|
|
|
468
|
+
ORIGIN_KEY: String
|
|
469
|
+
|
|
468
470
|
# Remembers the current request phase's sign-in under key, which the
|
|
469
471
|
# provider sends back to the callback: the strategy's own data, plus
|
|
470
472
|
# the origin and params under "origin" and "params".
|