@nxgt/janus 0.8.7 → 0.8.8
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/docs/guide/email-flows.md +2 -2
- package/docs/guide/sign-in-code.md +3 -4
- package/docs/roadmap.md +11 -19
- package/package.json +1 -1
|
@@ -32,11 +32,11 @@ verified.emailVerified; // true
|
|
|
32
32
|
## Ready-made e-mails — `@nxgt/janus-mail`
|
|
33
33
|
|
|
34
34
|
`sendMail` above is yours to write, or
|
|
35
|
-
[`@nxgt/janus-mail`](https://
|
|
35
|
+
[`@nxgt/janus-mail`](https://www.npmjs.com/package/@nxgt/janus-mail)
|
|
36
36
|
writes it: it takes what `send` and `request` answer, as they answer it, and
|
|
37
37
|
sends the verification and reset e-mails — and the *password changed* and
|
|
38
38
|
*e-mail changed* notices — in English and French, over any `@nxgt/mail`
|
|
39
|
-
transport.
|
|
39
|
+
transport.
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
42
|
import { janusMail } from '@nxgt/janus-mail';
|
|
@@ -160,11 +160,10 @@ sign-in completes in the browser that started it.
|
|
|
160
160
|
Send it to `issued.email`, not to what the visitor typed: it is the address
|
|
161
161
|
the user's field holds, as they registered it.
|
|
162
162
|
|
|
163
|
-
[`@nxgt/janus-mail`](https://
|
|
163
|
+
[`@nxgt/janus-mail`](https://www.npmjs.com/package/@nxgt/janus-mail)
|
|
164
164
|
sends this e-mail ready-made, in English and French, over any `@nxgt/mail`
|
|
165
|
-
transport
|
|
166
|
-
|
|
167
|
-
reaches the e-mail, nor a template of yours.
|
|
165
|
+
transport. It takes the whole `IssuedCode` and reads only `code` and
|
|
166
|
+
`email`: the challenge never reaches the e-mail, nor a template of yours.
|
|
168
167
|
|
|
169
168
|
```ts
|
|
170
169
|
if (issued !== null) await mail.signInCode(issued, { locale: 'fr-CA' }); // the recipient's locale: sent in fr
|
package/docs/roadmap.md
CHANGED
|
@@ -5,21 +5,7 @@ dates here, and the version something shipped in is the only number.
|
|
|
5
5
|
|
|
6
6
|
## Now
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
`@nxgt/janus-mail`, built on the `@nxgt/mail` toolkit shared with
|
|
10
|
-
applications that are not about sign-in: its `Mailer` port takes your
|
|
11
|
-
transport (SMTP, Resend…), and a transport that fails throws, like a store.
|
|
12
|
-
`janusMail({ mailer, from, brand, links })` takes what each flow answers —
|
|
13
|
-
`await mail.verifyEmail(await auth.verifyEmail.send(user), { name, locale })`
|
|
14
|
-
— and sends five e-mails, in English and French: e-mail verification,
|
|
15
|
-
password reset, sign-in code, and the notices *password changed* and
|
|
16
|
-
*e-mail changed*. They are built once, when the package is built, with
|
|
17
|
-
Maizzle and Tailwind CSS — CSS inlined for mail clients, the text in ICU
|
|
18
|
-
catalogues — and only filled at send time, every value escaped, your brand
|
|
19
|
-
included: no template engine in your server. Any one of them can be your
|
|
20
|
-
own function — React Email, a string — and a language beyond the two takes
|
|
21
|
-
all five. Built and tested in this repository, not yet published; see its
|
|
22
|
-
[README](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus-mail/README.md).
|
|
8
|
+
Nothing between releases.
|
|
23
9
|
|
|
24
10
|
## Next
|
|
25
11
|
|
|
@@ -84,6 +70,16 @@ dates here, and the version something shipped in is the only number.
|
|
|
84
70
|
The last ten, newest first, each with the version it came in. Everything
|
|
85
71
|
before is in the [CHANGELOG](../CHANGELOG.md).
|
|
86
72
|
|
|
73
|
+
- **Sending the e-mails, `@nxgt/janus-mail` v0.1.0** — a package of its
|
|
74
|
+
own, built on the `@nxgt/mail` toolkit: `janusMail({ mailer, from, brand,
|
|
75
|
+
links })` takes what each flow answers —
|
|
76
|
+
`await mail.verifyEmail(await auth.verifyEmail.send(user), { name, locale })`
|
|
77
|
+
— and sends five e-mails, in English and French, over any `@nxgt/mail`
|
|
78
|
+
transport: e-mail verification, password reset, sign-in code, and the
|
|
79
|
+
notices *password changed* and *e-mail changed*. They are built once with
|
|
80
|
+
Maizzle when the package is built, and only filled in at send time, every
|
|
81
|
+
value escaped: no template engine in your server. A transport that fails
|
|
82
|
+
throws, like a store.
|
|
87
83
|
- **A permission id no store can keep is held by nobody** — an object or
|
|
88
84
|
subject id holding a NUL character or a lone surrogate answers `false` from
|
|
89
85
|
`can()` and an empty page from `list()`, before any store call, and a
|
|
@@ -154,7 +150,3 @@ before is in the [CHANGELOG](../CHANGELOG.md).
|
|
|
154
150
|
audit trail, never a login, a password, a session token or a one-time token;
|
|
155
151
|
and [`@nxgt/janus-kit`](https://www.npmjs.com/package/@nxgt/janus-kit), all
|
|
156
152
|
of it wired in one call.
|
|
157
|
-
- **A NUL character or a lone surrogate never reaches a store** — refused in
|
|
158
|
-
fields with `USER_INVALID` on every adapter, rather than `STORE_FAILED` on
|
|
159
|
-
PostgreSQL alone; a login holding one is nobody's. The conformance suite
|
|
160
|
-
holds every adapter to round-tripping every other character. — v0.2.1
|