rodauth-select-account 0.0.3 → 0.0.4
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/CHANGELOG.md +18 -0
- data/README.md +1 -1
- data/lib/rodauth/features/select_account.rb +11 -5
- data/lib/rodauth/select-account/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c881e5c48400dfdb20e8c6d4c085ca195fe901477ac632cbc901217ab745b34
|
4
|
+
data.tar.gz: 8af197d3e4766928985775c4532954d3c7f519231872b1875411936b80c46fb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65a384392c409fba38c4d04087c59bd78a278fa795924414c7ff4e3269191bf07a271e448e800d843332d6e70c3bfadb861b69c64fb09d841d6b2ec15cd11df
|
7
|
+
data.tar.gz: e7ebbc98509dea51383abc86fe54f633620e5f2e16b2fa503a68c14754f8aef75016cca9d54717c26e93ac3ddae85b0880bb10060397ffcc5eed56468658b690
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
3
|
## master
|
4
|
+
|
5
|
+
## 0.0.4
|
6
|
+
|
7
|
+
Cookies used for selected account are now secure by default (httponly on, secure if request is TLS-enabled);
|
8
|
+
|
9
|
+
Cookie path is now "/" by default.
|
10
|
+
|
11
|
+
## 0.0.3
|
12
|
+
|
13
|
+
bugfix: fixing calls to the view helpers when in multi-phase login mode.
|
14
|
+
|
15
|
+
## 0.0.2
|
16
|
+
|
17
|
+
bugfix: added missing form templates.
|
18
|
+
|
19
|
+
## 0.0.1
|
20
|
+
|
21
|
+
Initial draft, all features added.
|
data/README.md
CHANGED
@@ -127,7 +127,7 @@ These are also available methods:
|
|
127
127
|
|
128
128
|
## Ruby support policy
|
129
129
|
|
130
|
-
The minimum Ruby version required to run `rodauth-select-account` is 2.4 . Besides that, it
|
130
|
+
The minimum Ruby version required to run `rodauth-select-account` is 2.4 . Besides that, it supports all rubies that rodauth and roda support, including JRuby and truffleruby.
|
131
131
|
|
132
132
|
## Development
|
133
133
|
|
@@ -54,15 +54,18 @@ module Rodauth
|
|
54
54
|
def require_select_account
|
55
55
|
# whether an account has been selected for a certain workflow will be driven by a short-lived
|
56
56
|
# cookie, which will hopefully be active during the duration of account selection
|
57
|
+
opts = Hash[accounts_cookie_options]
|
58
|
+
opts[:path] = "/" unless opts.key?(:path)
|
57
59
|
if request.cookies[require_selected_account_cookie_key]
|
58
|
-
::Rack::Utils.delete_cookie_header!(response.headers, require_selected_account_cookie_key)
|
60
|
+
::Rack::Utils.delete_cookie_header!(response.headers, require_selected_account_cookie_key, opts)
|
59
61
|
return
|
60
62
|
end
|
61
63
|
|
62
|
-
opts =
|
63
|
-
|
64
|
-
|
65
|
-
|
64
|
+
opts[:value] = true
|
65
|
+
opts[:expires] = Time.now + require_selected_account_cookie_interval
|
66
|
+
opts[:httponly] = true unless opts.key?(:httponly)
|
67
|
+
opts[:secure] = true unless opts.key?(:secure) || !request.ssl?
|
68
|
+
|
66
69
|
::Rack::Utils.set_cookie_header!(response.headers, require_selected_account_cookie_key, opts)
|
67
70
|
|
68
71
|
# should redirect to the accounts page, and set this as the page to return to
|
@@ -170,6 +173,9 @@ module Rodauth
|
|
170
173
|
opts = Hash[accounts_cookie_options]
|
171
174
|
opts[:value] = accounts_cookie.join(",")
|
172
175
|
opts[:expires] = Time.now + accounts_cookie_interval
|
176
|
+
opts[:path] = "/" unless opts.key?(:path)
|
177
|
+
opts[:httponly] = true unless opts.key?(:httponly)
|
178
|
+
opts[:secure] = true unless opts.key?(:secure) || !request.ssl?
|
173
179
|
::Rack::Utils.set_cookie_header!(response.headers, accounts_cookie_key, opts)
|
174
180
|
end
|
175
181
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodauth-select-account
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Multiple authenticated accounts per session in rodauth.
|
14
14
|
email:
|
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
|
-
rubygems_version: 3.1.
|
53
|
+
rubygems_version: 3.1.4
|
54
54
|
signing_key:
|
55
55
|
specification_version: 4
|
56
56
|
summary: Multiple authenticated accounts per session in rodauth.
|