logto
logto copied to clipboard
refactor(core): add koaAutoConsent middleware
Summary
Add the koaAutoConsent
middleware to the /consent
page.
For all the first-party apps we will auto-consent all the missing scopes.
Instead of redirecting the user to the client page and sending a consent request, auto consent at the router level and directly redirect to the auth endpoint.
This should simplify the auto-consent flow by omitting the intermediate consent loading page.
Testing
test locally
Checklist
- [ ]
.changeset
- [ ] unit tests
- [x] integration tests
- [x] necessary TSDoc comments
COMPARE TO master
Total Size Diff :chart_with_upwards_trend: +1016 Bytes
Diff by File
Name | Diff |
---|---|
packages/core/src/libraries/quota.ts | :chart_with_upwards_trend: +3 Bytes |
packages/core/src/libraries/session.test.ts | :chart_with_upwards_trend: +4.22 KB |
packages/core/src/libraries/session.ts | :chart_with_upwards_trend: +1.61 KB |
packages/core/src/middleware/koa-auto-consent.ts | :chart_with_upwards_trend: +962 Bytes |
packages/core/src/routes/interaction/consent.test.ts | :chart_with_upwards_trend: +5.01 KB |
packages/core/src/routes/interaction/consent.ts | :chart_with_upwards_trend: +1.25 KB |
packages/core/src/tenants/Tenant.ts | :chart_with_upwards_trend: +222 Bytes |
packages/core/src/test-utils/oidc-provider.ts | :chart_with_upwards_trend: +91 Bytes |
packages/integration-tests/src/client/index.ts | :chart_with_upwards_trend: +192 Bytes |