@columenlabs/lumen-people 0.1.67 → 0.1.68
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/dist/routes.js +6 -3
- package/package.json +2 -2
package/dist/routes.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* be same-origin JSON: a signed-in browser session is a cookie, so a foreign page's form or fetch
|
|
9
9
|
* is refused before it reaches a rule.
|
|
10
10
|
*/
|
|
11
|
-
import { levelLabel, levelOf, } from '@columenlabs/lumen-ui-types/people';
|
|
11
|
+
import { levelLabel, levelOf, normEmail, } from '@columenlabs/lumen-ui-types/people';
|
|
12
12
|
import { checkResend, emailView, resolveDraft, storedMailer, testResend, } from './email.js';
|
|
13
13
|
import { inviteTemplate } from './mailer.js';
|
|
14
14
|
const HEADERS = { 'content-type': 'application/json', 'cache-control': 'no-store' };
|
|
@@ -255,16 +255,19 @@ export function peopleRoutes(o) {
|
|
|
255
255
|
if (!r.ok)
|
|
256
256
|
return fail(r.error);
|
|
257
257
|
if (m === 'POST' && (parts[1] === 'check' || parts[1] === 'test') && parts.length === 2) {
|
|
258
|
+
const to = draft.testTo ? normEmail(draft.testTo) : actor.email;
|
|
259
|
+
if (!to)
|
|
260
|
+
return fail('Enter one email address to send the test to.');
|
|
258
261
|
const res = parts[1] === 'check'
|
|
259
262
|
? await checkResend(r.config, r.where)
|
|
260
|
-
: await testResend(r.config, r.where,
|
|
263
|
+
: await testResend(r.config, r.where, to, o.appName);
|
|
261
264
|
const t = { ...res, by: actor.email };
|
|
262
265
|
await email.store.putTest?.(req, t);
|
|
263
266
|
await people.log(via, {
|
|
264
267
|
kind: 'mail',
|
|
265
268
|
op: t.kind,
|
|
266
269
|
target: 'Email',
|
|
267
|
-
detail: `${t.kind === 'test' ?
|
|
270
|
+
detail: `${t.kind === 'test' ? `Test email to ${to}` : 'Connection check'} ${t.ok ? 'passed' : 'failed'} · ${r.where}`,
|
|
268
271
|
...(t.ok ? {} : { refused: t.steps.find((s) => s.ok === false)?.text ?? 'failed' }),
|
|
269
272
|
});
|
|
270
273
|
return json(t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-people",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.68",
|
|
4
4
|
"description": "Lumen's people, access and invites on the server: the rules, a SQL store, single-use invite links, a pluggable mailer and the routes the People screens call.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -52,6 +52,6 @@
|
|
|
52
52
|
"registry": "https://registry.npmjs.org/"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
55
|
+
"@columenlabs/lumen-ui-types": "0.1.68"
|
|
56
56
|
}
|
|
57
57
|
}
|