@amedia/user 1.4.0 → 1.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 +8 -0
- package/README.md +5 -5
- package/index.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @amedia/user
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1288](https://github.com/amedia/amedia-user-js/pull/1288) [`0c491c8`](https://github.com/amedia/amedia-user-js/commit/0c491c83673c88b87d8b4fcc995563f477d6b3d7) Thanks [@hennikul](https://github.com/hennikul)! - Rename the verification requirement's `session` field to `verifiedSession`, which reaches aID as `verified_session`. A query param named exactly `session` is stripped at Amedia's edge on publication domains, so the session half of a requirement never arrived: alone it came back `invalid_request`, and next to an attribute it was dropped silently, leaving aID to report `completed` for a session requirement it never checked. Requirements naming `verifiedSession` now reach aID intact.
|
|
8
|
+
|
|
9
|
+
`maxAge: 0` is also accepted now. It is OIDC's "prove it now" — aID resolves it against the moment the reader left the page — and it was the one value the wrapper refused, pushing callers toward a small positive number that can reject the very proof the flow just made. Negative and fractional values are still rejected, and the one-year ceiling still applies.
|
|
10
|
+
|
|
3
11
|
## 1.4.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -349,14 +349,14 @@ features are attained, or TimeoutError.
|
|
|
349
349
|
Make sure the reader has been through aID Identity Verification before you let them do something that requires it.
|
|
350
350
|
|
|
351
351
|
A requirement names what must be proven. `attributes` are values that must be verified on the user (`name`,
|
|
352
|
-
`birth_date`, `email`, `phone`), and `
|
|
353
|
-
At least one of the two is required. The two are different things: an attribute verification persists on the
|
|
354
|
-
a session stamp dies with the session.
|
|
352
|
+
`birth_date`, `email`, `phone`), and `verifiedSession: true` means this browser session must itself carry a verification
|
|
353
|
+
stamp. At least one of the two is required. The two are different things: an attribute verification persists on the
|
|
354
|
+
user, while a session stamp dies with the session.
|
|
355
355
|
|
|
356
356
|
```ts
|
|
357
357
|
const { satisfied } = await requireVerification({
|
|
358
358
|
attributes: ['birth_date'],
|
|
359
|
-
|
|
359
|
+
verifiedSession: true,
|
|
360
360
|
context: 'ung-activation',
|
|
361
361
|
});
|
|
362
362
|
// satisfied === true → nothing was missing, and nothing happened
|
|
@@ -392,7 +392,7 @@ The rest of the requirement is optional:
|
|
|
392
392
|
| name | type | description |
|
|
393
393
|
| ------------ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
394
394
|
| sources | Array<'eid' \| 'otp'> | Which kinds of source are acceptable. Left out, the attribute implies it: contact details route to a one-time code, identity to an eID. Provider names are deliberately not part of this API. |
|
|
395
|
-
| maxAge | string \| number | Force a re-verify when the proof is older than this. Seconds, or a duration such as `'30m'`, `'2h'`, `'1d'`.
|
|
395
|
+
| maxAge | string \| number | Force a re-verify when the proof is older than this. Seconds, or a duration such as `'30m'`, `'2h'`, `'1d'`. `0` demands a proof made since the reader left the page. |
|
|
396
396
|
| requestedUrl | string | Where the reader lands afterwards. Defaults to the current page. |
|
|
397
397
|
| context | string | Tracking, as on `goToLoginPage`. |
|
|
398
398
|
|
package/index.d.ts
CHANGED
|
@@ -116,10 +116,10 @@ type VerificationRequirement = {
|
|
|
116
116
|
/** Attributes that must be verified on the user. */
|
|
117
117
|
attributes?: VerifiableAttribute[];
|
|
118
118
|
/** Whether the browser session must carry a verification stamp. */
|
|
119
|
-
|
|
119
|
+
verifiedSession?: boolean;
|
|
120
120
|
/** Which kinds of source are acceptable. Omitted, the attribute implies it. */
|
|
121
121
|
sources?: VerificationSource[];
|
|
122
|
-
/** Force a re-verify when the proof is older than this. Seconds, or `30m`. */
|
|
122
|
+
/** Force a re-verify when the proof is older than this. Seconds, or `30m`. `0` means prove it now. */
|
|
123
123
|
maxAge?: string | number;
|
|
124
124
|
/** Where the reader lands afterwards. Defaults to the current page. */
|
|
125
125
|
requestedUrl?: string;
|