@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.
- package/auth-core/client.d.ts +10 -4
- package/auth-core/client.js +13 -5
- package/package.json +1 -1
package/auth-core/client.d.ts
CHANGED
|
@@ -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.
|
|
91
|
-
*
|
|
92
|
-
*
|
|
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(
|
|
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
|
package/auth-core/client.js
CHANGED
|
@@ -570,14 +570,22 @@ export class RoboSystemsAuthClient {
|
|
|
570
570
|
return this.finalizeAuthResponse(response.data);
|
|
571
571
|
}
|
|
572
572
|
/**
|
|
573
|
-
* Begin enrollment.
|
|
574
|
-
*
|
|
575
|
-
*
|
|
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(
|
|
579
|
+
async getPasskeyRegistrationOptions(proof) {
|
|
578
580
|
const response = await getPasskeyRegistrationOptions({
|
|
579
581
|
client: this.client,
|
|
580
|
-
|
|
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