@asgardeo/auth-spa 0.2.17 → 0.2.20
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/.eslintrc.js +1 -2
- package/README.md +12 -5
- package/babel.config.js +1 -2
- package/dist/asgardeo-spa.production.esm.js +100 -42
- package/dist/asgardeo-spa.production.esm.js.map +1 -1
- package/dist/asgardeo-spa.production.js +101 -43
- package/dist/asgardeo-spa.production.js.map +1 -1
- package/dist/asgardeo-spa.production.min.js +1 -1
- package/dist/asgardeo-spa.production.min.js.map +1 -1
- package/dist/polyfilled/asgardeo-spa.production.esm.js +98 -40
- package/dist/polyfilled/asgardeo-spa.production.esm.js.map +1 -1
- package/dist/polyfilled/asgardeo-spa.production.js +98 -40
- package/dist/polyfilled/asgardeo-spa.production.js.map +1 -1
- package/dist/polyfilled/asgardeo-spa.production.min.js +1 -1
- package/dist/polyfilled/asgardeo-spa.production.min.js.map +1 -1
- package/dist/src/client.d.ts +3 -2
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +13 -4
- package/dist/src/client.js.map +1 -1
- package/dist/src/clients/main-thread-client.d.ts.map +1 -1
- package/dist/src/clients/main-thread-client.js +41 -25
- package/dist/src/clients/main-thread-client.js.map +1 -1
- package/dist/src/clients/web-worker-client.d.ts +1 -1
- package/dist/src/clients/web-worker-client.d.ts.map +1 -1
- package/dist/src/clients/web-worker-client.js +55 -30
- package/dist/src/clients/web-worker-client.js.map +1 -1
- package/dist/src/constants/errors.d.ts +19 -0
- package/dist/src/constants/errors.d.ts.map +1 -0
- package/dist/src/constants/errors.js +19 -0
- package/dist/src/constants/errors.js.map +1 -0
- package/dist/src/constants/hooks.d.ts +2 -1
- package/dist/src/constants/hooks.d.ts.map +1 -1
- package/dist/src/constants/hooks.js +1 -0
- package/dist/src/constants/hooks.js.map +1 -1
- package/dist/src/constants/index.d.ts +1 -0
- package/dist/src/constants/index.d.ts.map +1 -1
- package/dist/src/constants/index.js +1 -0
- package/dist/src/constants/index.js.map +1 -1
- package/dist/src/constants/parameters.d.ts +1 -0
- package/dist/src/constants/parameters.d.ts.map +1 -1
- package/dist/src/constants/parameters.js +1 -0
- package/dist/src/constants/parameters.js.map +1 -1
- package/dist/src/helpers/session-management-helper.d.ts +1 -1
- package/dist/src/helpers/session-management-helper.d.ts.map +1 -1
- package/dist/src/helpers/session-management-helper.js +33 -43
- package/dist/src/helpers/session-management-helper.js.map +1 -1
- package/dist/src/index-polyfill.d.ts +0 -1
- package/dist/src/index-polyfill.d.ts.map +1 -1
- package/dist/src/index-polyfill.js +0 -1
- package/dist/src/index-polyfill.js.map +1 -1
- package/dist/src/models/client.d.ts +3 -3
- package/dist/src/models/client.d.ts.map +1 -1
- package/dist/src/models/http-client.d.ts +1 -1
- package/dist/src/models/http-client.d.ts.map +1 -1
- package/dist/src/models/index.d.ts +1 -0
- package/dist/src/models/index.d.ts.map +1 -1
- package/dist/src/models/index.js +1 -0
- package/dist/src/models/index.js.map +1 -1
- package/dist/src/models/message.d.ts +1 -0
- package/dist/src/models/message.d.ts.map +1 -1
- package/dist/src/models/request-custom-grant.d.ts +25 -0
- package/dist/src/models/request-custom-grant.d.ts.map +1 -0
- package/dist/src/models/request-custom-grant.js +19 -0
- package/dist/src/models/request-custom-grant.js.map +1 -0
- package/dist/src/models/session-management-helper.d.ts +2 -1
- package/dist/src/models/session-management-helper.d.ts.map +1 -1
- package/dist/src/models/sign-out-error.d.ts +22 -0
- package/dist/src/models/sign-out-error.d.ts.map +1 -0
- package/dist/src/models/sign-out-error.js +19 -0
- package/dist/src/models/sign-out-error.js.map +1 -0
- package/dist/src/models/web-worker.d.ts +3 -3
- package/dist/src/models/web-worker.d.ts.map +1 -1
- package/dist/src/models/web-worker.js.map +1 -1
- package/dist/src/public-api.d.ts +1 -1
- package/dist/src/public-api.d.ts.map +1 -1
- package/dist/src/public-api.js +1 -1
- package/dist/src/public-api.js.map +1 -1
- package/dist/src/utils/crypto-utils.d.ts +35 -0
- package/dist/src/utils/crypto-utils.d.ts.map +1 -0
- package/dist/src/utils/crypto-utils.js +58 -0
- package/dist/src/utils/crypto-utils.js.map +1 -0
- package/dist/src/utils/spa-utils.d.ts +5 -3
- package/dist/src/utils/spa-utils.d.ts.map +1 -1
- package/dist/src/utils/spa-utils.js +26 -10
- package/dist/src/utils/spa-utils.js.map +1 -1
- package/dist/src/worker/client.worker.js +2 -2
- package/dist/src/worker/client.worker.js.map +1 -1
- package/dist/src/worker/worker-core.d.ts.map +1 -1
- package/dist/src/worker/worker-core.js +26 -26
- package/dist/src/worker/worker-core.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -30
- package/rollup.config.js +3 -5
- package/src/client.ts +22 -8
- package/src/clients/main-thread-client.ts +52 -21
- package/src/clients/web-worker-client.ts +67 -26
- package/src/constants/errors.ts +19 -0
- package/src/constants/hooks.ts +2 -1
- package/src/constants/index.ts +1 -0
- package/src/constants/parameters.ts +1 -0
- package/src/helpers/session-management-helper.ts +31 -40
- package/src/index-polyfill.ts +0 -1
- package/src/models/client.ts +3 -2
- package/src/models/http-client.ts +3 -2
- package/src/models/index.ts +1 -0
- package/src/models/message.ts +1 -0
- package/src/models/request-custom-grant.ts +26 -0
- package/src/models/session-management-helper.ts +3 -2
- package/src/models/sign-out-error.ts +22 -0
- package/src/models/web-worker.ts +8 -2
- package/src/public-api.ts +2 -1
- package/src/utils/crypto-utils.ts +78 -0
- package/src/utils/spa-utils.ts +33 -10
- package/src/worker/client.worker.ts +1 -1
- package/src/worker/worker-core.ts +29 -27
package/.eslintrc.js
CHANGED
|
@@ -27,8 +27,7 @@ module.exports = {
|
|
|
27
27
|
"@typescript-eslint/explicit-function-return-type": 0,
|
|
28
28
|
"@typescript-eslint/no-explicit-any": 0,
|
|
29
29
|
"@typescript-eslint/no-inferrable-types": "off",
|
|
30
|
-
"@typescript-eslint/no-unused-vars": "
|
|
31
|
-
"@typescript-eslint/no-unused-vars-experimental": "warn",
|
|
30
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
32
31
|
"@typescript-eslint/no-use-before-define": ["warn", {
|
|
33
32
|
classes: false,
|
|
34
33
|
functions: false,
|
package/README.md
CHANGED
|
@@ -145,15 +145,15 @@ auth.on("sign-in", (response) => {
|
|
|
145
145
|
Before trying out the sample apps, you need to create an application in **Asgardeo**.
|
|
146
146
|
|
|
147
147
|
1. Navigate to [**Asgardeo Console**](https://console.asgardeo.io/login) and click on **Applications** under **Develop** tab
|
|
148
|
-
|
|
148
|
+
|
|
149
149
|
2. Click on **New Application** and then **Single Page Application**.
|
|
150
|
-
|
|
150
|
+
|
|
151
151
|
3. Enter **Sample** as the name of the app and add the redirect URL(s). You can find the relevant redirect URL(s) of each sample app in the [Running the sample apps](#2-running-the-sample-apps) section.
|
|
152
|
-
|
|
152
|
+
|
|
153
153
|
4. Click on Register. You will be navigated to management page of the **sample** application.
|
|
154
|
-
|
|
154
|
+
|
|
155
155
|
5. Add `https://localhost:5000` to **Allowed Origins** under **Access** tab and check **Public client** option.
|
|
156
|
-
|
|
156
|
+
|
|
157
157
|
6. Click on **Update** at the bottom.
|
|
158
158
|
|
|
159
159
|
### 2. Running the sample apps
|
|
@@ -725,6 +725,7 @@ If you are using TypeScript, you may want to use the `Hooks` enum that consists
|
|
|
725
725
|
| `"http-request-success"` | `httpRequest()` (Called when an http requests returns a response successfully) |
|
|
726
726
|
| `"revoke-access-token"` | `revokeAccessToken()` | A boolean value indicating if the process was successful or not |
|
|
727
727
|
| `"custom-grant"` | `customGrant()` | Returns the response from the custom grant request. |
|
|
728
|
+
| `sign-out-failed` | `signOut()` (Called when sign out fails) | An object of type [`SignOutError`](#SignOutError).|
|
|
728
729
|
|
|
729
730
|
**When the user signs out, the user is taken to the Asgardeo's logout page and then redirected back to the SPA on successful log out. Hence, developers should ensure that the `"sign-out"` hook is called when the page the user is redirected to loads.**
|
|
730
731
|
|
|
@@ -1016,6 +1017,12 @@ This extends the `AxiosRequestConfig` by providing an additional attribute that
|
|
|
1016
1017
|
|--|--|--|
|
|
1017
1018
|
|attachToken| `boolean`| Specifies if the access token should be attached to the header of the request.|
|
|
1018
1019
|
|
|
1020
|
+
### SignOutError
|
|
1021
|
+
| Attribute | Type | Description |
|
|
1022
|
+
| ------------------ | ---------------------- | ---------------------------------------------- |
|
|
1023
|
+
| error | `string` | The error message. |
|
|
1024
|
+
| error_description | `string` | The error description. |
|
|
1025
|
+
|
|
1019
1026
|
## Develop
|
|
1020
1027
|
|
|
1021
1028
|
### Prerequisites
|
package/babel.config.js
CHANGED