@robosystems/core 0.8.0 → 0.8.1

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.
@@ -87,11 +87,17 @@ export declare class RoboSystemsAuthClient {
87
87
  /** Passwordless login: assertion → session. */
88
88
  completePasskeyLogin(assertion: Record<string, unknown>): Promise<AuthResponse>;
89
89
  /**
90
- * Begin enrollment. Authenticated settings flow omits `mfaToken`; the
91
- * forced-enrollment lane passes the token from an
92
- * `mfa_enrollment_required` login.
90
+ * Begin enrollment. The settings lane must carry a fresh re-auth proof —
91
+ * `password`, or a reauth-ceremony `assertion` when adding a passkey
92
+ * beside an existing one; a session alone is refused by the backend. The
93
+ * forced-enrollment lane passes only the `mfaToken` from an
94
+ * `mfa_enrollment_required` login, which is its own freshness proof.
93
95
  */
94
- getPasskeyRegistrationOptions(mfaToken?: string): Promise<Record<string, unknown>>;
96
+ getPasskeyRegistrationOptions(proof?: {
97
+ mfaToken?: string;
98
+ password?: string;
99
+ assertion?: Record<string, unknown>;
100
+ }): Promise<Record<string, unknown>>;
95
101
  /**
96
102
  * Finish enrollment. First passkey returns recovery codes (once); in the
97
103
  * forced-enrollment lane the result carries the completed login and the
@@ -570,14 +570,22 @@ export class RoboSystemsAuthClient {
570
570
  return this.finalizeAuthResponse(response.data);
571
571
  }
572
572
  /**
573
- * Begin enrollment. Authenticated settings flow omits `mfaToken`; the
574
- * forced-enrollment lane passes the token from an
575
- * `mfa_enrollment_required` login.
573
+ * Begin enrollment. The settings lane must carry a fresh re-auth proof —
574
+ * `password`, or a reauth-ceremony `assertion` when adding a passkey
575
+ * beside an existing one; a session alone is refused by the backend. The
576
+ * forced-enrollment lane passes only the `mfaToken` from an
577
+ * `mfa_enrollment_required` login, which is its own freshness proof.
576
578
  */
577
- async getPasskeyRegistrationOptions(mfaToken) {
579
+ async getPasskeyRegistrationOptions(proof) {
578
580
  const response = await getPasskeyRegistrationOptions({
579
581
  client: this.client,
580
- body: { mfa_token: mfaToken },
582
+ // The proof fields land in client 1.11's generated request model;
583
+ // until the regen they ride as extra JSON properties, hence the cast.
584
+ body: {
585
+ mfa_token: proof === null || proof === void 0 ? void 0 : proof.mfaToken,
586
+ password: proof === null || proof === void 0 ? void 0 : proof.password,
587
+ assertion: proof === null || proof === void 0 ? void 0 : proof.assertion,
588
+ },
581
589
  });
582
590
  return response.data.options;
583
591
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosystems/core",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Shared RoboSystems frontend core library (auth, contexts, task monitoring, UI components) for the RoboSystems Next.js apps",
5
5
  "license": "MIT",
6
6
  "private": false,