@aooth/auth-moost 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/dist/index.mjs +9 -1
  2. package/package.json +10 -10
package/dist/index.mjs CHANGED
@@ -638,6 +638,14 @@ var AuthWorkflowBase = class {
638
638
  enrollPickPhase(deps) {
639
639
  const { ctx, username, users, forms, transports, issuer } = deps;
640
640
  if (!ctx.enrollAvailableTransports) ctx.enrollAvailableTransports = [...transports];
641
+ if (transports.length === 0) {
642
+ if (deps.mode === "optional") {
643
+ ctx.enrollDone = true;
644
+ deps.onComplete?.(ctx);
645
+ return;
646
+ }
647
+ throw new HttpError$1(500, "MFA enrollment is required but no transports are configured. Override `prepareMfaSetup` to provide at least one transport, or set `mfaMode` to 'disabled'.");
648
+ }
641
649
  if (transports.length === 1) ctx.enrollMethod = transports[0];
642
650
  else {
643
651
  const wf = useAtscriptWf(forms.pickMethod);
@@ -3440,7 +3448,7 @@ __decorate([
3440
3448
  condition: (ctx) => !ctx.mfaChecked && ctx.mfaMethod === "totp"
3441
3449
  },
3442
3450
  {
3443
- condition: (ctx) => !ctx.mfaChecked && (ctx.mfaEnrolledMethods?.length ?? 0) === 0,
3451
+ condition: (ctx) => !ctx.mfaChecked && (ctx.mfaEnrolledMethods?.length ?? 0) === 0 && (ctx.availableMfaTransports?.length ?? 0) > 0,
3444
3452
  steps: [
3445
3453
  {
3446
3454
  id: "enroll-pick-method",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/auth-moost",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Moost auth integration for aoothjs — AuthGuard interceptor, useAuth composable, REST endpoints, workflows",
5
5
  "keywords": [
6
6
  "aoothjs",
@@ -51,21 +51,21 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@atscript/moost-wf": "^0.1.77",
54
+ "@atscript/moost-wf": "^0.1.78",
55
55
  "@wooksjs/http-body": "^0.7.15",
56
- "@aooth/arbac-moost": "^0.1.5",
57
- "@aooth/auth": "0.1.5",
58
- "@aooth/user": "0.1.5"
56
+ "@aooth/arbac-moost": "^0.1.6",
57
+ "@aooth/auth": "0.1.6",
58
+ "@aooth/user": "0.1.6"
59
59
  },
60
60
  "devDependencies": {
61
- "@atscript/core": "^0.1.63",
62
- "@atscript/typescript": "^0.1.63",
63
- "@atscript/ui": "^0.1.77",
64
- "@atscript/ui-fns": "^0.1.77",
61
+ "@atscript/core": "^0.1.64",
62
+ "@atscript/typescript": "^0.1.64",
63
+ "@atscript/ui": "^0.1.78",
64
+ "@atscript/ui-fns": "^0.1.78",
65
65
  "@moostjs/event-http": "^0.6.17",
66
66
  "@moostjs/event-wf": "^0.6.17",
67
67
  "moost": "^0.6.17",
68
- "unplugin-atscript": "^0.1.63",
68
+ "unplugin-atscript": "^0.1.64",
69
69
  "wooks": "^0.7.15"
70
70
  },
71
71
  "peerDependencies": {