saasufy-components 3.21.0 → 3.21.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.
Files changed (2) hide show
  1. package/README.md +24 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -166,7 +166,27 @@ Note that the `app-router` can contain any number of pages/routes so the `slot="
166
166
  </app-router>
167
167
  ```
168
168
 
169
- The app router path is based on the `location.hash` so the path section in your browser's address bar needs to start with the `#` character.
169
+ This example shows how to redirect based on the user's authentication status:
170
+
171
+ ```html
172
+ <app-router default-page="/home">
173
+ <template slot="page" route-path="/log-in" auth-redirect="/home" hard-redirect>
174
+ <log-in-form
175
+ hostname="sas.saasufy.com"
176
+ port="443"
177
+ network-symbol="sas"
178
+ chain-module-name="sas_chain"
179
+ secure="true"
180
+ ></log-in-form>
181
+ </template>
182
+ <template slot="page" route-path="/home" no-auth-redirect="/log-in">
183
+ <div>This is the home page</div>
184
+ </template>
185
+ <div slot="viewport"></div>
186
+ </app-router>
187
+ ```
188
+
189
+ Note that the app router path is based on `location.hash` so the path section in your browser's address bar needs to start with the `#` character.
170
190
  So for example, if your `index.html` file is served up from the URL `http://mywebsite.com`, then, to activate the `/products` route as in the example above, you would need to type the URL `http://mywebsite.com#/products`.
171
191
 
172
192
  **Attributes of app-router**
@@ -180,9 +200,9 @@ So for example, if your `index.html` file is served up from the URL `http://mywe
180
200
  - `route-path`: The path of the page. Supports custom URL parameters in the format `/org/:orgId/user/:userId`.
181
201
  - `partial-route`: An optional attribute which, if specified, will allow the `route-path` to be matched partially from the start. This can be used to ignore the ending of a path which is not relevant to the page in order to avoid unnecessary re-renders.
182
202
  - `redirect`: An optional path/route which this page should redirect to. Note that the content of this page will not be shown so it should always be empty.
183
- - `auth-redirect`: An optional path/route which this page should redirect to if the user is authenticated. If the user is not authenticated, then the content of the template will be displayed as normal.
184
- - `no-auth-redirect`: An optional path/route which this page should redirect to if the user is not authenticated. If the user is authenticated, then the content of the template will be displayed as normal.
185
- - `hard-redirect`: An optional, additional attribute which can be specified alongside a `redirect`, `auth-redirect` or `no-auth-redirect` attribute to ensure that any redirect will change the URL in the address bar. Redirects are `soft` redirects by default; this means that they redirect the user to the target page but keep the current URL path unchanged.
203
+ - `no-auth-redirect`: An optional alternative path/route to redirect to if the user lands on this page but they are not authenticated. If the user is authenticated, then the content of the template will be displayed as normal.
204
+ - `auth-redirect`: An optional alternative path/route to redirect to if the user lands on this page but they are already authenticated. If the user is not authenticated, then the content of the template will be displayed as normal.
205
+ - `hard-redirect`: An optional, additional attribute which can be specified alongside a `redirect`, `no-auth-redirect` or `auth-redirect` attribute to ensure that any redirect will change the URL in the address bar. Redirects are `soft` redirects by default; this means that they redirect the user to the target page but keep the current URL path unchanged.
186
206
 
187
207
  ### socket-provider
188
208
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "3.21.0",
3
+ "version": "3.21.1",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {