@jskit-ai/connectors-catalog 0.2.37 → 0.2.38
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/package.json +1 -1
- package/test/resend.test.js +7 -2
package/package.json
CHANGED
package/test/resend.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import { createLocalAuthService, createLocalFileBackend } from "../../auth-provider-local-core/src/server/lib/index.js";
|
|
4
|
+
import { createLocalAuthService, createLocalDeliveries, createLocalFileBackend } from "../../auth-provider-local-core/src/server/lib/index.js";
|
|
5
5
|
import { localServiceOptions } from "../../auth-provider-local-core/test-support/localService.js";
|
|
6
6
|
import { readFile, rm } from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
@@ -82,14 +82,19 @@ test("documented application wiring sends auth recovery through the Resend adapt
|
|
|
82
82
|
// Evaluate only the trusted repository example to keep application wiring verified.
|
|
83
83
|
const createRecoverySender = new Function("createHash", `${example.replace('import { createHash } from "node:crypto";', "")}\nreturn createRecoverySender;`)(createHash);
|
|
84
84
|
const sender = createRecoverySender({ connections: service, context, integrationId: "mail", from: input.from });
|
|
85
|
+
const options = localServiceOptions({ env: { APP_PUBLIC_URL: "https://app.example.com" }, emailRecovery: true });
|
|
86
|
+
const deliveries = createLocalDeliveries({ logger: options.logger });
|
|
85
87
|
const auth = createLocalAuthService({
|
|
86
|
-
...
|
|
88
|
+
...options,
|
|
87
89
|
backend: createLocalFileBackend({ storeDir: path.join(directory, "auth") }),
|
|
90
|
+
deliveries,
|
|
88
91
|
recoverySender: sender
|
|
89
92
|
});
|
|
90
93
|
await auth.register({ email: "person@example.com", password: "correct horse battery staple" });
|
|
91
94
|
const result = await auth.requestPasswordReset({ email: "person@example.com" });
|
|
92
95
|
assert.equal(result.recoveryUrl, undefined);
|
|
96
|
+
// Local auth sends the email after it has answered.
|
|
97
|
+
assert.equal(await deliveries.settled(), true);
|
|
93
98
|
assert.equal(requests.length, 2);
|
|
94
99
|
const body = JSON.parse(requests[1].init.body);
|
|
95
100
|
assert.deepEqual(body.to, ["person@example.com"]);
|