rodauth-select-account 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b3ae1b644a42cc9fd9b6cd06937820f93dba507756668480ba0c3cb3b77d072
4
- data.tar.gz: c96c9d556acaa1d4f6af1dea63544773edcf8ca2e4538fbab7ce867c64be59c8
3
+ metadata.gz: 54558f068bac6c32c070a056d1b4ffbc6b86878fbbedd2b5b4561b97233a169e
4
+ data.tar.gz: ae04cf2fedd5df579a98969ad6ca2e8154e78a2451ebabf244fc0015a34c3ae9
5
5
  SHA512:
6
- metadata.gz: 5166fbda42b1e662b34664c7860efc77c3f15f9f976d6668a1b1fcefb744b7b5a8840567a24d8a695305171adc1f05c31c1357b13f87363e7e268bc672e002c8
7
- data.tar.gz: 5f3be74d4dfb774a878f9b6e45421777ca1dfec9c117ef864ffb8183b96fde9c8c33ceda0a2ec75cbf0b020143060f382c244064c7d5e3db24ab032db5b397d4
6
+ metadata.gz: 82210732ab64e6ce8c418767daebd2e69833f224c068c594725c12f171eed0871f955079ebcfa6c93a35f7eeee7e49e779d293ad4fa6b45f66b0d6acf90bdd90
7
+ data.tar.gz: 14d2ec75e8f69e4e160e016d6b50a95f4697e05739e4edf9f74bcd5406dc3c3f274592afc6c036390a3596415116bd15490b358cd92a87842ea0ce98b58ffed7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.1.3
6
+
7
+ * allow setting `require_selected_account_cookie_interval` and `accounts_cookie_interval` to `nil` in order to set the managed cookies as "Session Cookies" (i.e. getting wiped out on browser close).
8
+
9
+ ## 0.1.2
10
+
11
+ point release to update project links in rubygems.
12
+
5
13
  ## 0.1.1
6
14
 
7
15
  Updating integration with `rodauth-i18n`, which changed the setup for `v0.2.0`.
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Rodauth::SelectAccount
2
2
 
3
- [![pipeline status](https://gitlab.com/honeyryderchuck/rodauth-select-account/badges/master/pipeline.svg)](https://gitlab.com/honeyryderchuck/rodauth-select-account/-/pipelines?page=1&ref=master)
4
- [![coverage report](https://gitlab.com/honeyryderchuck/rodauth-select-account/badges/master/coverage.svg)](https://honeyryderchuck.gitlab.io/rodauth-select-account/coverage/#_AllFiles)
3
+ [![Gem Version](https://badge.fury.io/rb/rodauth-select-account.svg)](http://rubygems.org/gems/rodauth-select-account)
4
+ [![pipeline status](https://gitlab.com/os85/rodauth-select-account/badges/master/pipeline.svg)](https://gitlab.com/os85/rodauth-select-account/-/pipelines?page=1&ref=master)
5
+ [![coverage report](https://gitlab.com/os85/rodauth-select-account/badges/master/coverage.svg)](https://os85.gitlab.io/rodauth-select-account/coverage/#_AllFiles)
5
6
 
6
7
  This gem adds a feature to `rodauth` to support the management of multiple accounts in the same session. The behaviour is similar to how the "Google Sign-In" widget works, where you can sign-in with a different account, or switch to an already authenticated account.
7
8
 
@@ -129,7 +130,7 @@ These are also available methods:
129
130
 
130
131
  `rodauth-select-account` supports translating all user-facing text found in all pages and forms and buttons, by integrating with [rodauth-i18n](https://github.com/janko/rodauth-i18n). Just set it up in your application and `rodauth` configuration.
131
132
 
132
- Default translations shipping with `rodauth-select-account` can be found [in this directory](https://gitlab.com/honeyryderchuck/rodauth-select-account/-/tree/master/locales). If they're not available for the languages you'd like to support, consider getting them translated from the english text, and contributing them to this repository via a Merge Request.
133
+ Default translations shipping with `rodauth-select-account` can be found [in this directory](https://gitlab.com/os85/rodauth-select-account/-/tree/master/locales). If they're not available for the languages you'd like to support, consider getting them translated from the english text, and contributing them to this repository via a Merge Request.
133
134
 
134
135
  (This feature is available since `v0.1`.)
135
136
 
@@ -143,4 +144,4 @@ After checking out the repo, run `bundle install` to install dependencies. Then,
143
144
 
144
145
  ## Contributing
145
146
 
146
- Bug reports and pull requests are welcome on Gitlab at https://gitlab.com/honeyryderchuck/rodauth-select-account.
147
+ Bug reports and pull requests are welcome on Gitlab at https://gitlab.com/os85/rodauth-select-account.
@@ -0,0 +1,47 @@
1
+ = Documentation for Select Account
2
+
3
+ The +select_account+ feature allows for maintaining and switching across multiple accounts in the same session.
4
+
5
+ == Auth Value Methods
6
+
7
+ selected_account_key :: session key where the selected account state is stored.
8
+ accounts_key :: session key where the logged-in accounts state is stored.
9
+ add_account_redirect_session_key :: session key where the url to redirect to after adding an account is stored.
10
+ select_account_redirect_session_key :: session key where the url to redirect to after selecting an account is stored.
11
+ require_selected_account_cookie_key :: cookie key storing whether a selected account is required.
12
+ require_selected_account_cookie_interval :: duration for the require selected account cookie (5 minutes by default); can be set to <tt>nil</tt> in order not to set cookie "Expires".
13
+ accounts_cookie_key :: cookie key where the selected accounts are stored.
14
+ accounts_cookie_options :: cookie options for the selected accounts cookie
15
+ accounts_cookie_interval :: duration for the selected accounts cookie (14 days by default); can be set to <tt>nil</tt> in order not to set cookie "Expires".
16
+ no_account_error_status :: http status code for the response when the account to switch to does not exist anymore.
17
+ select_account_required_error_status :: http status code for the response when a selected account is required.
18
+ add_account_required_error_status :: http status code for the response when addig an account is required.
19
+ no_account_message :: error description when no account was found, <tt>"could not select account"</tt> by default.
20
+
21
+
22
+ add_account_button :: Label of add account button.
23
+ add_account_error_flash :: The flash error message to display when there was an error adding an account.
24
+ add_account_notice_flash :: The flash success message to display after adding an account.
25
+ require_add_account_error_flash :: he flash error message to display when adding an account is required.
26
+ add_account_page_title :: Title for the Add Account form.
27
+ add_account_redirect :: URL to redirect to after adding an account.
28
+ add_account_route :: the route for adding an account, +add-account+ by default.
29
+
30
+ select_account_error_flash :: The flash error message to display when there was an error selecting an account.
31
+ select_account_notice_flash :: The flash success message to display after selecting an account.
32
+ require_select_account_error_flash :: he flash error message to display when selecting an account is required.
33
+ select_account_page_title :: Title for the Select Account form.
34
+ select_account_redirect :: URL to redirect to after selecting an account.
35
+ select_account_route :: the route for selecting an account, +select-account+ by default.
36
+
37
+
38
+ == Auth Methods
39
+
40
+ add_account_view :: The HTML template of the Add Account form.
41
+ before_add_account_route :: Run arbitrary code before the add account route.
42
+ before_add_account :: Run arbitrary code before adding an account.
43
+ after_add_account :: Run arbitrary code after adding an account.
44
+ select_account_view :: The HTML template of the Select Account form.
45
+ before_select_account_route :: Run arbitrary code before the add account route.
46
+ before_select_account :: Run arbitrary code before selecting an account.
47
+ after_select_account :: Run arbitrary code after selecting an account.
@@ -1,4 +1,4 @@
1
- # frozen-string-literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Rodauth
4
4
  Feature.define(:select_account) do
@@ -62,7 +62,7 @@ module Rodauth
62
62
  end
63
63
 
64
64
  opts[:value] = true
65
- opts[:expires] = Time.now + require_selected_account_cookie_interval
65
+ opts[:expires] = Time.now + require_selected_account_cookie_interval if require_selected_account_cookie_interval
66
66
  opts[:httponly] = true unless opts.key?(:httponly)
67
67
  opts[:secure] = true unless opts.key?(:secure) || !request.ssl?
68
68
 
@@ -177,7 +177,7 @@ module Rodauth
177
177
 
178
178
  opts = Hash[accounts_cookie_options]
179
179
  opts[:value] = accounts_cookie.join(",")
180
- opts[:expires] = Time.now + accounts_cookie_interval
180
+ opts[:expires] = Time.now + accounts_cookie_interval if accounts_cookie_interval
181
181
  opts[:path] = "/" unless opts.key?(:path)
182
182
  opts[:httponly] = true unless opts.key?(:httponly)
183
183
  opts[:secure] = true unless opts.key?(:secure) || !request.ssl?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rodauth
4
4
  module SelectAccount
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
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.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-04 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rodauth
@@ -33,10 +33,12 @@ extra_rdoc_files:
33
33
  - LICENSE.txt
34
34
  - README.md
35
35
  - CHANGELOG.md
36
+ - doc/select_account.rdoc
36
37
  files:
37
38
  - CHANGELOG.md
38
39
  - LICENSE.txt
39
40
  - README.md
41
+ - doc/select_account.rdoc
40
42
  - lib/rodauth/features/select_account.rb
41
43
  - lib/rodauth/select-account.rb
42
44
  - lib/rodauth/select-account/version.rb
@@ -44,12 +46,11 @@ files:
44
46
  - templates/add-account-form.str
45
47
  - templates/add-account.str
46
48
  - templates/select-account.str
47
- homepage: https://gitlab.com/honeyryderchuck/rodauth-select-account
48
- licenses: []
49
+ homepage: https://gitlab.com/os85/rodauth-select-account
50
+ licenses:
51
+ - Apache 2.0
49
52
  metadata:
50
- homepage_uri: https://gitlab.com/honeyryderchuck/rodauth-select-account
51
- source_code_uri: https://gitlab.com/honeyryderchuck/rodauth-select-account
52
- changelog_uri: https://gitlab.com/honeyryderchuck/rodauth-select-account/-/blob/master/CHANGELOG.md
53
+ rubygems_mfa_required: 'true'
53
54
  post_install_message:
54
55
  rdoc_options: []
55
56
  require_paths:
@@ -58,14 +59,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
58
59
  requirements:
59
60
  - - ">="
60
61
  - !ruby/object:Gem::Version
61
- version: '0'
62
+ version: 2.4.0
62
63
  required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  requirements:
64
65
  - - ">="
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
68
  requirements: []
68
- rubygems_version: 3.2.22
69
+ rubygems_version: 3.5.3
69
70
  signing_key:
70
71
  specification_version: 4
71
72
  summary: Multiple authenticated accounts per session in rodauth.