saasufy-components 9.4.1 → 9.5.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.
package/README.md CHANGED
@@ -974,7 +974,7 @@ A link to initiate an OAuth flow to authenticate a user as part of log in. Can s
974
974
  - `client-id` (required): This is the client ID from the third-party OAuth provider.
975
975
  - `state-size`: This allows you to control the size (in bytes) of the random state string which is passed to the OAuth provider as part of the OAuth flow. Defaults to 20.
976
976
  - `state-storage-key`: The state string is stored in the browser's `sessionStorage` under this key. Defaults to `oauth.state`. It must match the value provided to the `oauth-handler` component at the end of the OAuth flow.
977
- - `use-local-storage`: By default, the state is stored inside sessionStorage. If this property is set, then the state will be stored inside localStorage instead. This is useful for sharing the state across different tabs. If set, this attribute should also be set on the related `oauth-handler` component.
977
+ - `use-session-storage`: By default, the state is stored inside localStorage. If this property is set, then the state will be stored inside sessionStorage instead. If set, this attribute should also be set on the related `oauth-handler` component.
978
978
 
979
979
  ### oauth-handler
980
980
 
@@ -1004,7 +1004,7 @@ When using an OAuth provider, the callback URL which you register with the provi
1004
1004
  - `code-param-name`: The name of the query parameter which holds the `code` as provided by the OAuth provider within the OAuth callback URL. Defaults to `code`.
1005
1005
  - `state-param-name`: The name of the query parameter which holds the `state` as provided by the OAuth provider within the OAuth callback URL. Defaults to `state`.
1006
1006
  - `auth-timeout`: The number of milliseconds to wait for authentication to complete before timing out. Defaults to 10000 (10 seconds).
1007
- - `use-local-storage`: By default, the state is retrieved from sessionStorage. If this property is set, then the state will be retrieved from localStorage instead. This is useful for sharing the state across different tabs. If set, this attribute should also be set on the related `oauth-link` component.
1007
+ - `use-session-storage`: By default, the state is retrieved from localStorage. If this property is set, then the state will be retrieved from sessionStorage instead. If set, this attribute should also be set on the related `oauth-link` component.
1008
1008
 
1009
1009
  ### render-group
1010
1010
 
package/oauth-handler.js CHANGED
@@ -33,7 +33,7 @@ class OAuthHandler extends SocketConsumer {
33
33
  throw new Error('The provider attribute of oauth-handler was not specified');
34
34
  }
35
35
 
36
- let useLocalStorage = this.hasAttribute('use-local-storage');
36
+ let useLocalStorage = !this.hasAttribute('use-session-storage');
37
37
  let storageKey = this.getAttribute('state-storage-key') || 'oauth.state';
38
38
  let expectedOAuthState = (useLocalStorage ? localStorage : sessionStorage).getItem(storageKey);
39
39
  if (!expectedOAuthState) {
package/oauth-link.js CHANGED
@@ -17,7 +17,7 @@ class OAuthLink extends HTMLElement {
17
17
  'client-id',
18
18
  'state-size',
19
19
  'state-storage-key',
20
- 'use-local-storage'
20
+ 'use-session-storage'
21
21
  ];
22
22
  }
23
23
 
@@ -77,7 +77,7 @@ class OAuthLink extends HTMLElement {
77
77
  if (!provider) {
78
78
  throw new Error('The provider attribute of oauth-link was not specified');
79
79
  }
80
- let useLocalStorage = this.hasAttribute('use-local-storage');
80
+ let useLocalStorage = !this.hasAttribute('use-session-storage');
81
81
  let stateSize = Number(this.getAttribute('state-size') || 20);
82
82
  let storageKey = this.getAttribute('state-storage-key') || 'oauth.state';
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "9.4.1",
3
+ "version": "9.5.1",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {