cabloy 5.1.189 → 5.1.191
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/.cabloy-version +1 -1
- package/CHANGELOG.md +25 -0
- package/CLAUDE.md +1 -0
- package/README.md +2 -2
- package/package.json +1 -1
- package/repo-docs/.vitepress/config.mjs +1 -0
- package/repo-docs/demo.md +12 -0
- package/repo-docs/index.md +3 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-cli/cli-set-api/toolsIsolate/test.ts +2 -2
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/core/application.ts +5 -6
- package/vona/packages-vona/vona-core/src/lib/utils/util.ts +7 -2
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/service/product.ts +4 -4
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/productContent.test.ts +10 -3
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/bean/payScene.commerceOrder.ts +5 -3
- package/vona/src/suite/a-home/modules/home-index/src/bean/meta.printTip.ts +1 -1
- package/vona/src/suite/a-home/modules/home-user/test/accountPasswordReset.test.ts +9 -17
- package/vona/src/suite/a-home/modules/home-user/test/accountPasswordSet.test.ts +9 -17
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/src/controller/passport.ts +4 -2
- package/vona/src/suite-vendor/a-auth/modules/a-auth/test/oauthRequestContext.test.ts +123 -146
- package/vona/src/suite-vendor/a-auth/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/paymentCallback.ts +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/package.json +5 -5
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-core/src/bean/bean.core.ts +0 -16
- package/vona/src/suite-vendor/a-vona/modules/a-core/src/bean/meta.runtime.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.betterSqlite3.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-security/test/origin.test.ts +12 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +2 -7
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionOperationsRow.tsx +19 -13
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +11 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockToolbarBulk/controller.tsx +7 -4
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/formFieldDetails/controller.tsx +14 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/detailsPermissions.ts +65 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/utils.ts +3 -3
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/details.ts +6 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/test/lib/detailsPermissions.test.ts +125 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/permissions.ts +2 -8
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +2 -1
- package/zova/src/suite-vendor/a-zova/package.json +3 -3
package/.cabloy-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.1.
|
|
1
|
+
5.1.191
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.1.191
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Update functionality with the latest enhancements.
|
|
8
|
+
|
|
9
|
+
### Improvements
|
|
10
|
+
|
|
11
|
+
- Refresh the demo and documentation in the README and index pages.
|
|
12
|
+
|
|
13
|
+
## 5.1.190
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- Update application and authentication capabilities.
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
- Correct test coverage and authentication request handling.
|
|
22
|
+
|
|
23
|
+
### Improvements
|
|
24
|
+
|
|
25
|
+
- Simplify `bean.core` by removing obsolete methods.
|
|
26
|
+
- Update application, Passport, OAuth request context, and project documentation.
|
|
27
|
+
|
|
3
28
|
## 5.1.189
|
|
4
29
|
|
|
5
30
|
### Features
|
package/CLAUDE.md
CHANGED
|
@@ -88,6 +88,7 @@ Before inventing a custom implementation path:
|
|
|
88
88
|
- For replay-safe transient failures, use `@Core.retryable(...)` with an explicit `errorCodes` allowlist. It retries the downstream AOP suffix, so place it closest to the method when it must wrap and retry a `@Core.transaction(...)` boundary; use `ownerOnly: true` for dual-role leaves that must not retry inside a caller-owned transaction; do not retry external side effects or infer retryability from isolation level.
|
|
89
89
|
- Backend tests that use scoped Vona state must own an `app.bean.executor.mockCtx(...)` boundary; every intentionally competing operation must run in a separate `mockCtx(...)`.
|
|
90
90
|
- Do not set `TEST_CONCURRENCY=false` for normal `npm run test` or CI runs: an unset value defaults to concurrent execution. For stateful `node:test` suites, declare `{ concurrency: false }` explicitly. Prove business contention by explicitly launching competing operations and asserting their combined durable outcome, never through runner parallelism or scheduling.
|
|
91
|
+
- Unit tests must not temporarily mutate process-global origin or proxy configuration, including `app.config.server.serve.protocol`, `app.config.server.serve.host`, and `app.proxy`. Model request-origin cases with an explicit `req` fixture, and use the established `AppUtil` loopback fallback for requestless local URLs. Do not introduce a broad origin lock to serialize such tests; retain narrowly scoped locks only for genuinely shared domain state.
|
|
91
92
|
- Unit tests must delete every test-owned persisted resource in `finally`, using precise owned identities and reverse dependency order.
|
|
92
93
|
- Shared durable test or local-development fixtures must be created through the owning module's `meta.version.ts` `seed()` hook and treated as read-only by tests; the managed seed path starts from a newly recreated database rather than repeating against one database.
|
|
93
94
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/cabloy)
|
|
5
5
|
[](https://www.npmjs.com/package/cabloy)
|
|
6
6
|
[](https://cabloy.com)
|
|
7
|
-
[](https://cabloy.com)
|
|
7
|
+
[](https://cabloy.com/demo)
|
|
8
8
|
|
|
9
9
|
Cabloy is a Node.js fullstack framework for AI vibe coding, with AI Spec-Driven Development for traceable, evidence-backed delivery.
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ Cabloy is a Node.js fullstack framework for AI vibe coding, with AI Spec-Driven
|
|
|
12
12
|
|
|
13
13
|
Instead of stitching separate backend and frontend stacks together, Cabloy keeps their contracts, tooling, and guidance connected in one repository. [AI Spec-Driven Development](https://cabloy.com/ai/ai-spec-driven-development) provides the disciplined path from confirmed Specs to evidence-backed delivery; its precise engineering method is Traceable Spec Delivery. Vona is its backend framework and runtime layer, and Zova is its frontend framework and application layer. Cabloy Basic and Cabloy Start are related, complete edition baselines built on that shared architecture; see [Editions Overview](https://cabloy.com/editions/overview) for their deliberate differences.
|
|
14
14
|
|
|
15
|
-
[Documentation](https://cabloy.com) · [npm](https://www.npmjs.com/package/cabloy) · [
|
|
15
|
+
[Documentation](https://cabloy.com) · [npm](https://www.npmjs.com/package/cabloy) · [Demo](https://cabloy.com/demo) · [GitHub](https://github.com/cabloy/cabloy)
|
|
16
16
|
|
|
17
17
|
## Fullstack Principles
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -245,6 +245,7 @@ export default defineConfig({
|
|
|
245
245
|
{ text: 'Frontend (Zova)', link: '/frontend/introduction', activeMatch: '^/frontend/' },
|
|
246
246
|
],
|
|
247
247
|
},
|
|
248
|
+
{ text: 'Demo', link: '/demo' },
|
|
248
249
|
{ text: 'Blogs', link: '/blogs/', activeMatch: '^/blogs/' },
|
|
249
250
|
{ text: 'Editions', link: '/editions/overview', activeMatch: '^/editions/' },
|
|
250
251
|
{ text: 'AI Development', link: '/ai/introduction', activeMatch: '^/ai/' },
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Demo
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Demo
|
|
6
|
+
|
|
7
|
+
Explore the Cabloy demonstration sites:
|
|
8
|
+
|
|
9
|
+
| Site | URL |
|
|
10
|
+
| ---------- | ---------------------------------------------------------------- |
|
|
11
|
+
| Web site | [https://demo.cabloy.com/](https://demo.cabloy.com/) |
|
|
12
|
+
| Admin site | [https://demo.cabloy.com/admin/](https://demo.cabloy.com/admin/) |
|
package/repo-docs/index.md
CHANGED
|
@@ -99,8 +99,8 @@ async function testRun(projectPath: string, coverage: boolean, patterns: string[
|
|
|
99
99
|
.on('test:coverage', data => {
|
|
100
100
|
outputCoverageReport(data.summary.totals);
|
|
101
101
|
})
|
|
102
|
-
.on('test:pass',
|
|
103
|
-
if (
|
|
102
|
+
.on('test:pass', data => {
|
|
103
|
+
if (data.nesting === 0 && data.name === '---done---') {
|
|
104
104
|
void closeApplicationOnce();
|
|
105
105
|
}
|
|
106
106
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.101",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size",
|
|
6
6
|
"keywords": [
|
|
@@ -72,10 +72,9 @@ export class VonaApplication extends KoaApplication {
|
|
|
72
72
|
if (req) {
|
|
73
73
|
request = req;
|
|
74
74
|
} else {
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const host = (this.config ? this.util.host : undefined) || hostFallback;
|
|
75
|
+
const protocol = 'http';
|
|
76
|
+
const port = this.meta.env.SERVER_LISTEN_PORT;
|
|
77
|
+
const host = port ? `localhost:${port}` : 'localhost';
|
|
79
78
|
const hostname = new URL(`${protocol}://${host}`).hostname;
|
|
80
79
|
request = {
|
|
81
80
|
headers: {
|
|
@@ -89,12 +88,12 @@ export class VonaApplication extends KoaApplication {
|
|
|
89
88
|
host,
|
|
90
89
|
hostname,
|
|
91
90
|
protocol,
|
|
92
|
-
secure:
|
|
91
|
+
secure: false,
|
|
93
92
|
method: 'POST',
|
|
94
93
|
url: '',
|
|
95
94
|
path: '',
|
|
96
95
|
socket: {
|
|
97
|
-
encrypted:
|
|
96
|
+
encrypted: false,
|
|
98
97
|
remoteAddress: '127.0.0.1',
|
|
99
98
|
remotePort: 7001,
|
|
100
99
|
},
|
|
@@ -61,12 +61,17 @@ export class AppUtil extends BeanSimple {
|
|
|
61
61
|
|
|
62
62
|
get protocol() {
|
|
63
63
|
const config = this.ctx ? this.ctx.config : this.app.config;
|
|
64
|
-
return config.server.serve.protocol || this.ctx?.protocol;
|
|
64
|
+
return config.server.serve.protocol || this.ctx?.protocol || 'http';
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
get host() {
|
|
68
68
|
const config = this.ctx ? this.ctx.config : this.app.config;
|
|
69
|
-
|
|
69
|
+
let host = config.server.serve.host || this.ctx?.host;
|
|
70
|
+
if (!host) {
|
|
71
|
+
const port = this.app.meta.env.SERVER_LISTEN_PORT;
|
|
72
|
+
host = port ? `localhost:${port}` : 'localhost';
|
|
73
|
+
}
|
|
74
|
+
return host;
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
getAbsoluteUrl(path?: string) {
|
|
@@ -17,11 +17,11 @@ import type { EntityProduct } from '../entity/product.tsx';
|
|
|
17
17
|
import type { ModelProduct } from '../model/product.ts';
|
|
18
18
|
|
|
19
19
|
const serializationRetryOptions = {
|
|
20
|
-
retries:
|
|
21
|
-
factor:
|
|
20
|
+
retries: 6,
|
|
21
|
+
factor: 2,
|
|
22
22
|
minTimeout: 10,
|
|
23
|
-
maxTimeout:
|
|
24
|
-
randomize:
|
|
23
|
+
maxTimeout: 160,
|
|
24
|
+
randomize: true,
|
|
25
25
|
errorCodes: [
|
|
26
26
|
'40001',
|
|
27
27
|
'ER_LOCK_DEADLOCK',
|
|
@@ -243,7 +243,7 @@ describe('productContent.test.ts', { concurrency: false }, () => {
|
|
|
243
243
|
return product.id;
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
-
await Promise.
|
|
246
|
+
const results = await Promise.allSettled(
|
|
247
247
|
markdowns.map(descriptionMarkdown =>
|
|
248
248
|
runInMockCtx(async () => {
|
|
249
249
|
await app.scope('commerce-catalog').service.product.update(productId, {
|
|
@@ -252,10 +252,17 @@ describe('productContent.test.ts', { concurrency: false }, () => {
|
|
|
252
252
|
}),
|
|
253
253
|
),
|
|
254
254
|
);
|
|
255
|
+
assert.deepEqual(
|
|
256
|
+
results.map(result => result.status),
|
|
257
|
+
['fulfilled', 'fulfilled'],
|
|
258
|
+
);
|
|
255
259
|
|
|
256
260
|
await runInMockCtx(async () => {
|
|
257
|
-
const
|
|
258
|
-
|
|
261
|
+
const storeds = await app.scope('commerce-catalog').model.productContent.select({
|
|
262
|
+
where: { productId },
|
|
263
|
+
});
|
|
264
|
+
assert.equal(storeds.length, 1);
|
|
265
|
+
const stored = storeds[0]!;
|
|
259
266
|
assert.ok(markdowns.includes(stored.descriptionMarkdown!));
|
|
260
267
|
assert.equal(
|
|
261
268
|
stored.descriptionHtml,
|
package/vona/src/suite/a-commerce/modules/commerce-payment/src/bean/payScene.commerceOrder.ts
CHANGED
|
@@ -23,7 +23,9 @@ import 'vona-module-a-ssr';
|
|
|
23
23
|
input.candidate.clientName,
|
|
24
24
|
);
|
|
25
25
|
const server = _ctx.app.config.server.serve;
|
|
26
|
-
const
|
|
26
|
+
const hasCallbackOrigin = _ctx.app.meta.isTest
|
|
27
|
+
? !!(_ctx.app.util.protocol && _ctx.app.util.host)
|
|
28
|
+
: !!(server.protocol && server.host);
|
|
27
29
|
if (input.candidate.key === 'paypal') {
|
|
28
30
|
const options = clientOptions as IPayProviderPaypalClientOptions;
|
|
29
31
|
return !!(
|
|
@@ -31,12 +33,12 @@ import 'vona-module-a-ssr';
|
|
|
31
33
|
options.secretCredential.clientSecret &&
|
|
32
34
|
options.webhookId &&
|
|
33
35
|
options.merchantReference &&
|
|
34
|
-
|
|
36
|
+
hasCallbackOrigin
|
|
35
37
|
);
|
|
36
38
|
}
|
|
37
39
|
if (input.candidate.key === 'stripe') {
|
|
38
40
|
const options = clientOptions as IPayProviderStripeClientOptions;
|
|
39
|
-
return !!(options.secretCredential && options.secretWebhook &&
|
|
41
|
+
return !!(options.secretCredential && options.secretWebhook && hasCallbackOrigin);
|
|
40
42
|
}
|
|
41
43
|
return false;
|
|
42
44
|
},
|
|
@@ -248,38 +248,30 @@ describe('accountPasswordReset.test.ts', { concurrency: false }, () => {
|
|
|
248
248
|
}
|
|
249
249
|
});
|
|
250
250
|
|
|
251
|
-
it('uses the
|
|
251
|
+
it('uses the fallback origin for an exact same-origin consumer without a whitelist entry', async () => {
|
|
252
252
|
let fixture: IAccountPasswordResetFixture | undefined;
|
|
253
253
|
let restoreConfig: (() => void) | undefined;
|
|
254
|
-
let serve: typeof app.config.server.serve | undefined;
|
|
255
|
-
let servePrevious: { protocol?: string; host?: string } | undefined;
|
|
256
254
|
try {
|
|
257
255
|
fixture = await createFixture({ simpleAuth: true });
|
|
258
256
|
restoreConfig = await configurePasswordReset([]);
|
|
259
|
-
await app.bean.executor.mockCtx(async () => {
|
|
260
|
-
serve = app.ctx.config.server.serve;
|
|
261
|
-
servePrevious = { ...serve };
|
|
262
|
-
(serve as any).host = 'canonical.example.test';
|
|
263
|
-
});
|
|
264
257
|
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
}
|
|
258
|
+
const port = app.meta.env.SERVER_LISTEN_PORT;
|
|
259
|
+
const fallbackOrigin = `http://${port ? `localhost:${port}` : 'localhost'}`;
|
|
260
|
+
const sameOriginConsumerUrl = `${fallbackOrigin}/home/user/password-reset`;
|
|
268
261
|
const issued = await issuePasswordResetLink(fixture, sameOriginConsumerUrl);
|
|
269
|
-
assert.equal(issued.origin,
|
|
262
|
+
assert.equal(issued.origin, fallbackOrigin);
|
|
270
263
|
assert.equal(issued.path, '/home/user/password-reset');
|
|
271
264
|
assert.equal(issued.search, `?token=${issued.token}`);
|
|
272
265
|
|
|
273
266
|
await clearPasswordResetState(fixture.userId);
|
|
274
267
|
await clearPasswordResetRecipientCooldown(fixture.email);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
268
|
+
await requestPasswordReset(
|
|
269
|
+
fixture.email,
|
|
270
|
+
'https://request.example.test/home/user/password-reset',
|
|
271
|
+
);
|
|
279
272
|
await assertNoPasswordResetState(fixture.userId);
|
|
280
273
|
await assertNoPasswordResetRecipientCooldown(fixture.email);
|
|
281
274
|
} finally {
|
|
282
|
-
if (serve && servePrevious) Object.assign(serve, servePrevious);
|
|
283
275
|
restoreConfig?.();
|
|
284
276
|
if (fixture) await removeFixture(fixture);
|
|
285
277
|
}
|
|
@@ -453,36 +453,28 @@ describe('accountPasswordSet.test.ts', { concurrency: false, sequential: true },
|
|
|
453
453
|
}
|
|
454
454
|
});
|
|
455
455
|
|
|
456
|
-
it('uses the
|
|
456
|
+
it('uses the fallback origin for an exact same-origin consumer without a whitelist entry', async () => {
|
|
457
457
|
let fixture: IAccountPasswordSetFixture | undefined;
|
|
458
458
|
let restoreConfig: (() => void) | undefined;
|
|
459
|
-
let serve: typeof app.config.server.serve | undefined;
|
|
460
|
-
let servePrevious: { protocol?: string; host?: string } | undefined;
|
|
461
459
|
try {
|
|
462
460
|
fixture = await createFixture();
|
|
463
461
|
restoreConfig = await configurePasswordSet([]);
|
|
464
|
-
await app.bean.executor.mockCtx(async () => {
|
|
465
|
-
serve = app.ctx.config.server.serve;
|
|
466
|
-
servePrevious = { ...serve };
|
|
467
|
-
(serve as any).host = 'canonical.example.test';
|
|
468
|
-
});
|
|
469
462
|
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
}
|
|
463
|
+
const port = app.meta.env.SERVER_LISTEN_PORT;
|
|
464
|
+
const fallbackOrigin = `http://${port ? `localhost:${port}` : 'localhost'}`;
|
|
465
|
+
const sameOriginConsumerUrl = `${fallbackOrigin}/home/user/password-set`;
|
|
473
466
|
const issued = await issuePasswordSetLink(fixture, sameOriginConsumerUrl);
|
|
474
|
-
assert.equal(issued.origin,
|
|
467
|
+
assert.equal(issued.origin, fallbackOrigin);
|
|
475
468
|
assert.equal(issued.path, '/home/user/password-set');
|
|
476
469
|
assert.equal(issued.search, `?token=${issued.token}`);
|
|
477
470
|
|
|
478
471
|
await clearPasswordSetState(fixture.userId);
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
472
|
+
await issuePasswordSetLinkRejected(
|
|
473
|
+
fixture,
|
|
474
|
+
'https://request.example.test/home/user/password-set',
|
|
475
|
+
);
|
|
483
476
|
await assertNoPasswordSetState(fixture.userId);
|
|
484
477
|
} finally {
|
|
485
|
-
if (serve && servePrevious) Object.assign(serve, servePrevious);
|
|
486
478
|
restoreConfig?.();
|
|
487
479
|
if (fixture) await removeFixture(fixture);
|
|
488
480
|
}
|
|
@@ -15,7 +15,7 @@ export class ControllerPassport extends BeanBase {
|
|
|
15
15
|
@Aspect.guardGlobal('a-user:passport', { public: true })
|
|
16
16
|
@Api.exclude()
|
|
17
17
|
async callback() {
|
|
18
|
-
const code = this.ctx.query.code as string;
|
|
18
|
+
// const code = this.ctx.query.code as string;
|
|
19
19
|
const stateQuery = this.ctx.query.state as string;
|
|
20
20
|
if (!stateQuery) this.app.throw(403);
|
|
21
21
|
const strategyState: IAuthenticateStrategyState = (await this.bean.jwt
|
|
@@ -23,7 +23,7 @@ export class ControllerPassport extends BeanBase {
|
|
|
23
23
|
.verify(stateQuery)) as unknown as IAuthenticateStrategyState;
|
|
24
24
|
return await this.bean.executor.newCtx(
|
|
25
25
|
async () => {
|
|
26
|
-
this.ctx.request.query = { code, state: stateQuery };
|
|
26
|
+
// this.ctx.request.query = { code, state: stateQuery };
|
|
27
27
|
return await this.scope.service.auth.authCallback(strategyState);
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -31,6 +31,8 @@ export class ControllerPassport extends BeanBase {
|
|
|
31
31
|
tz: strategyState.tz,
|
|
32
32
|
instanceName: strategyState.instanceName,
|
|
33
33
|
instance: true,
|
|
34
|
+
req: this.ctx.req,
|
|
35
|
+
res: this.ctx.res,
|
|
34
36
|
},
|
|
35
37
|
);
|
|
36
38
|
}
|