@aiveth/react 0.4.1 → 0.5.0
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/CHANGELOG.md +4 -0
- package/README.md +6 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 — 2026-11-26
|
|
4
|
+
|
|
5
|
+
- `audience` (on `AivethProvider` / `AivethClient`): your own API's address. The access token is then a signed token for that API, which it checks with `verifyAccessToken` (`@aiveth/node`).
|
|
6
|
+
|
|
3
7
|
## 0.4.1 — 2026-11-25
|
|
4
8
|
|
|
5
9
|
- Same version as `@aiveth/nextjs` 0.4.1. No change: `AivethButton` reads Aiveth's address, which
|
package/README.md
CHANGED
|
@@ -23,6 +23,12 @@ const token = await getAccessToken(); // Authorization: Bearer … for your API
|
|
|
23
23
|
- Refresh tokens (`offline_access`, asked by default) are swapped at every use.
|
|
24
24
|
- One app belongs to one organization in Aiveth, so there is no organization switcher.
|
|
25
25
|
|
|
26
|
+
## A token for your own API
|
|
27
|
+
|
|
28
|
+
Add `audience="https://api.your-app.com"` (registered under Developers → Your APIs) to
|
|
29
|
+
`AivethProvider`. The access token is then a signed token your API checks with
|
|
30
|
+
`verifyAccessToken` from `@aiveth/node`, with no call to Aiveth.
|
|
31
|
+
|
|
26
32
|
## Sign in in your organization's own look
|
|
27
33
|
|
|
28
34
|
`<AivethButton>` draws "Sign in" with what you set in Aiveth → Branding — colours (light and
|
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export interface AivethConfig {
|
|
|
5
5
|
/** Exactly one of the app's registered return addresses. */
|
|
6
6
|
redirectUri: string;
|
|
7
7
|
scope?: string;
|
|
8
|
+
/** Your own API's address, as registered under Developers → Your APIs. Set it and the access
|
|
9
|
+
* token is a signed token for that API, which it checks with `verifyAccessToken`
|
|
10
|
+
* (`@aiveth/node`) — no call to Aiveth. */
|
|
11
|
+
audience?: string;
|
|
8
12
|
/** Where Aiveth sends the person after signing out (registered under the app's sign-out). */
|
|
9
13
|
postLogoutRedirectUri?: string;
|
|
10
14
|
/** For tests. */
|
package/dist/client.js
CHANGED
|
@@ -109,6 +109,8 @@ export class AivethClient {
|
|
|
109
109
|
scope: this.config.scope ?? DEFAULT_SCOPE, state: pending.state, nonce: pending.nonce,
|
|
110
110
|
code_challenge: await challengeOf(verifier), code_challenge_method: 'S256',
|
|
111
111
|
});
|
|
112
|
+
if (this.config.audience)
|
|
113
|
+
query.set('resource', this.config.audience); // RFC 8707
|
|
112
114
|
this.navigate(`${found.authorization_endpoint}?${query}`);
|
|
113
115
|
}
|
|
114
116
|
/** On the return address: swap the code for tokens. Answers where the app wanted to go
|
package/package.json
CHANGED