@flow-industries/id 0.7.1 → 0.8.0

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.
@@ -307,6 +307,17 @@ export function createFlow(options = {}) {
307
307
  accessKeyPrep = await accessKeyModule.prepareAccessKey(accessKeyOptions, chain.id);
308
308
  extraCapabilities = { accessKeyHash: accessKeyPrep.accessKeyHash };
309
309
  }
310
+ // When the current session is a guest, forward its access token so a
311
+ // sign-up upgrades that guest in place even where the guest cookie is
312
+ // unreadable (the iOS top-level sign-up popup). The server verifies it
313
+ // before honoring it, so an app that never becomes a guest sends nothing.
314
+ const snapshot = store.getSnapshot();
315
+ if (snapshot.user?.isGuest && snapshot.jwt) {
316
+ extraCapabilities = {
317
+ ...(extraCapabilities ?? {}),
318
+ guestToken: snapshot.jwt,
319
+ };
320
+ }
310
321
  const { session, webauthn, refreshToken } = await runLogin({
311
322
  dialog: dialogHost,
312
323
  store,
@@ -7,6 +7,13 @@ export type ConnectCapabilities = {
7
7
  accessKeyHash?: string;
8
8
  signInHeadless?: boolean;
9
9
  credentialId?: string;
10
+ /**
11
+ * The current guest's access JWT, forwarded so a sign-up upgrades that guest
12
+ * in place even where the guest cookie is unreadable (the iOS top-level
13
+ * sign-up popup). The server verifies it before letting it stand in for the
14
+ * cookie session; see the register endpoint.
15
+ */
16
+ guestToken?: string;
10
17
  };
11
18
  export type ConnectRequest = [{
12
19
  capabilities?: ConnectCapabilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flow-industries/id",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "main": "./dist/sdk/client/index.js",
5
5
  "module": "./dist/sdk/client/index.js",
6
6
  "types": "./dist/sdk/client/index.d.ts",