@oxy.so/services 14.14.0 → 14.15.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.
Files changed (84) hide show
  1. package/lib/commonjs/index.js +19 -0
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/components/OxyAuthChooser.js +5 -2
  4. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  5. package/lib/commonjs/ui/components/OxySurfaceFrame.js +28 -0
  6. package/lib/commonjs/ui/components/OxySurfaceFrame.js.map +1 -0
  7. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +8 -5
  8. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -1
  9. package/lib/commonjs/ui/components/signIn/signInMethods.js +12 -10
  10. package/lib/commonjs/ui/components/signIn/signInMethods.js.map +1 -1
  11. package/lib/commonjs/ui/context/OxyContext.js +16 -4
  12. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  13. package/lib/commonjs/ui/hooks/useSurfaceFrameWidth.js +3 -0
  14. package/lib/commonjs/ui/hooks/useSurfaceFrameWidth.js.map +1 -1
  15. package/lib/commonjs/ui/utils/deliveryPlatform.js +8 -4
  16. package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -1
  17. package/lib/commonjs/ui/utils/signInDevice.js +32 -0
  18. package/lib/commonjs/ui/utils/signInDevice.js.map +1 -0
  19. package/lib/module/index.js +6 -0
  20. package/lib/module/index.js.map +1 -1
  21. package/lib/module/ui/components/OxyAuthChooser.js +5 -2
  22. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  23. package/lib/module/ui/components/OxySurfaceFrame.js +23 -0
  24. package/lib/module/ui/components/OxySurfaceFrame.js.map +1 -0
  25. package/lib/module/ui/components/signIn/OxySignInPanel.js +8 -5
  26. package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -1
  27. package/lib/module/ui/components/signIn/signInMethods.js +12 -10
  28. package/lib/module/ui/components/signIn/signInMethods.js.map +1 -1
  29. package/lib/module/ui/context/OxyContext.js +16 -4
  30. package/lib/module/ui/context/OxyContext.js.map +1 -1
  31. package/lib/module/ui/hooks/useSurfaceFrameWidth.js +3 -0
  32. package/lib/module/ui/hooks/useSurfaceFrameWidth.js.map +1 -1
  33. package/lib/module/ui/utils/deliveryPlatform.js +8 -4
  34. package/lib/module/ui/utils/deliveryPlatform.js.map +1 -1
  35. package/lib/module/ui/utils/signInDevice.js +28 -0
  36. package/lib/module/ui/utils/signInDevice.js.map +1 -0
  37. package/lib/typescript/commonjs/index.d.ts +4 -0
  38. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +5 -2
  40. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/ui/components/OxySurfaceFrame.d.ts +18 -0
  42. package/lib/typescript/commonjs/ui/components/OxySurfaceFrame.d.ts.map +1 -0
  43. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts +4 -2
  44. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts +15 -12
  46. package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/ui/hooks/useSurfaceFrameWidth.d.ts +3 -0
  49. package/lib/typescript/commonjs/ui/hooks/useSurfaceFrameWidth.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +4 -2
  51. package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts +88 -0
  53. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/ui/utils/signInDevice.d.ts +21 -0
  55. package/lib/typescript/commonjs/ui/utils/signInDevice.d.ts.map +1 -0
  56. package/lib/typescript/module/index.d.ts +4 -0
  57. package/lib/typescript/module/index.d.ts.map +1 -1
  58. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +5 -2
  59. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  60. package/lib/typescript/module/ui/components/OxySurfaceFrame.d.ts +18 -0
  61. package/lib/typescript/module/ui/components/OxySurfaceFrame.d.ts.map +1 -0
  62. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts +4 -2
  63. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
  64. package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts +15 -12
  65. package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts.map +1 -1
  66. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  67. package/lib/typescript/module/ui/hooks/useSurfaceFrameWidth.d.ts +3 -0
  68. package/lib/typescript/module/ui/hooks/useSurfaceFrameWidth.d.ts.map +1 -1
  69. package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +4 -2
  70. package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -1
  71. package/lib/typescript/module/ui/utils/identityCrypto.d.ts +88 -0
  72. package/lib/typescript/module/ui/utils/identityCrypto.d.ts.map +1 -1
  73. package/lib/typescript/module/ui/utils/signInDevice.d.ts +21 -0
  74. package/lib/typescript/module/ui/utils/signInDevice.d.ts.map +1 -0
  75. package/package.json +3 -3
  76. package/src/index.ts +9 -0
  77. package/src/ui/components/OxyAuthChooser.tsx +5 -2
  78. package/src/ui/components/OxySurfaceFrame.tsx +25 -0
  79. package/src/ui/components/signIn/OxySignInPanel.tsx +8 -5
  80. package/src/ui/components/signIn/signInMethods.ts +16 -13
  81. package/src/ui/context/OxyContext.tsx +25 -4
  82. package/src/ui/hooks/useSurfaceFrameWidth.ts +3 -0
  83. package/src/ui/utils/deliveryPlatform.ts +8 -4
  84. package/src/ui/utils/signInDevice.ts +28 -0
@@ -25,6 +25,7 @@ export declare const loadIdentityCrypto: () => Promise<{
25
25
  deleteOrganizationKey: typeof import("@oxy.so/core/crypto").deleteOrganizationKey;
26
26
  syncOrganizationKeys: typeof import("@oxy.so/core/crypto").syncOrganizationKeys;
27
27
  adoptOrganizationKeyFromRing: typeof import("@oxy.so/core/crypto").adoptOrganizationKeyFromRing;
28
+ revalidateHeldOrganizationKeys: typeof import("@oxy.so/core/crypto").revalidateHeldOrganizationKeys;
28
29
  isOrganizationAccountId: typeof import("@oxy.so/core/crypto").isOrganizationAccountId;
29
30
  isHealthyOrganizationKeyPair: typeof import("@oxy.so/core/crypto").isHealthyOrganizationKeyPair;
30
31
  OrganizationKeyIndexUnreadableError: typeof import("@oxy.so/core/crypto").OrganizationKeyIndexUnreadableError;
@@ -63,6 +64,12 @@ export declare const loadIdentityCrypto: () => Promise<{
63
64
  listQuarantinedOrganizationKeys: typeof import("@oxy.so/core/crypto").listQuarantinedOrganizationKeys;
64
65
  holdsRetiredRing: typeof import("@oxy.so/core/crypto").holdsRetiredRing;
65
66
  unmirrorPersonalRetiredKeys: typeof import("@oxy.so/core/crypto").unmirrorPersonalRetiredKeys;
67
+ quarantineRetiredIdentityKey: typeof import("@oxy.so/core/crypto").quarantineRetiredIdentityKey;
68
+ listQuarantinedIdentityKeys: typeof import("@oxy.so/core/crypto").listQuarantinedIdentityKeys;
69
+ signWithQuarantinedIdentityKey: typeof import("@oxy.so/core/crypto").signWithQuarantinedIdentityKey;
70
+ MAX_QUARANTINED_RING_ENTRIES: 64;
71
+ MAX_QUARANTINED_RING_ENTRIES_TOTAL: 256;
72
+ RetiredKeyQuarantineFullError: typeof import("@oxy.so/core/crypto").RetiredKeyQuarantineFullError;
66
73
  RetiredKeyRingUnreadableError: typeof import("@oxy.so/core/crypto").RetiredKeyRingUnreadableError;
67
74
  SignatureService: typeof import("@oxy.so/core/crypto").SignatureService;
68
75
  RecoveryPhraseService: typeof import("@oxy.so/core/crypto").RecoveryPhraseService;
@@ -88,5 +95,86 @@ export declare const loadIdentityCrypto: () => Promise<{
88
95
  loadCommonsIdentityBridge: typeof import("@oxy.so/protocol").loadCommonsIdentityBridge;
89
96
  signMessage: typeof import("@oxy.so/protocol").signMessage;
90
97
  verifySignature: typeof import("@oxy.so/protocol").verifySignature;
98
+ KeychainConflictError: typeof import("@oxy.so/core/crypto").KeychainConflictError;
99
+ KeychainCryptoError: typeof import("@oxy.so/core/crypto").KeychainCryptoError;
100
+ KeychainFormatError: typeof import("@oxy.so/core/crypto").KeychainFormatError;
101
+ KeychainIntegrityError: typeof import("@oxy.so/core/crypto").KeychainIntegrityError;
102
+ KeychainRosterError: typeof import("@oxy.so/core/crypto").KeychainRosterError;
103
+ KeychainStateError: typeof import("@oxy.so/core/crypto").KeychainStateError;
104
+ KEYCHAIN_RECOVERY: "recovery";
105
+ KEYCHAIN_ITEM_PADDING_BLOCK: 256;
106
+ KEYCHAIN_MAX_ITEM_PLAINTEXT: 48896;
107
+ keychainToBase64Url: typeof import("@oxy.so/core/crypto").keychainToBase64Url;
108
+ keychainFromBase64Url: typeof import("@oxy.so/core/crypto").keychainFromBase64Url;
109
+ keychainJcs: typeof import("@oxy.so/core/crypto").keychainJcs;
110
+ zeroize: typeof import("@oxy.so/core/crypto").zeroize;
111
+ keychainTimestamp: typeof import("@oxy.so/core/crypto").keychainTimestamp;
112
+ isKeychainTimestamp: typeof import("@oxy.so/core/crypto").isKeychainTimestamp;
113
+ generateDeviceKeys: typeof import("@oxy.so/core/crypto").generateDeviceKeys;
114
+ deviceKeysFromSecrets: typeof import("@oxy.so/core/crypto").deviceKeysFromSecrets;
115
+ exportPublicKeys: typeof import("@oxy.so/core/crypto").exportPublicKeys;
116
+ zeroizeKeyPairs: typeof import("@oxy.so/core/crypto").zeroizeKeyPairs;
117
+ keychainSeal: typeof import("@oxy.so/core/crypto").keychainSeal;
118
+ keychainOpenSealed: typeof import("@oxy.so/core/crypto").keychainOpenSealed;
119
+ generateRecoveryKey: typeof import("@oxy.so/core/crypto").generateRecoveryKey;
120
+ formatRecoveryKey: typeof import("@oxy.so/core/crypto").formatRecoveryKey;
121
+ parseRecoveryKey: typeof import("@oxy.so/core/crypto").parseRecoveryKey;
122
+ deriveRecoveryKeys: typeof import("@oxy.so/core/crypto").deriveRecoveryKeys;
123
+ recoveryKeyMatches: typeof import("@oxy.so/core/crypto").recoveryKeyMatches;
124
+ KEYCHAIN_PLATFORMS: readonly ["oxyos", "ios", "android", "macos", "windows", "linux", "web"];
125
+ rosterSigningInput: typeof import("@oxy.so/core/crypto").rosterSigningInput;
126
+ rosterEntryHash: typeof import("@oxy.so/core/crypto").rosterEntryHash;
127
+ parseRosterBody: typeof import("@oxy.so/core/crypto").parseRosterBody;
128
+ validateRosterBody: typeof import("@oxy.so/core/crypto").validateRosterBody;
129
+ parseMember: typeof import("@oxy.so/core/crypto").parseMember;
130
+ genesisBody: typeof import("@oxy.so/core/crypto").genesisBody;
131
+ addBody: typeof import("@oxy.so/core/crypto").addBody;
132
+ removeBody: typeof import("@oxy.so/core/crypto").removeBody;
133
+ generationBody: typeof import("@oxy.so/core/crypto").generationBody;
134
+ recoveryBody: typeof import("@oxy.so/core/crypto").recoveryBody;
135
+ signRosterBody: typeof import("@oxy.so/core/crypto").signRosterBody;
136
+ rosterHeadOf: typeof import("@oxy.so/core/crypto").rosterHeadOf;
137
+ verifyRoster: typeof import("@oxy.so/core/crypto").verifyRoster;
138
+ findMember: typeof import("@oxy.so/core/crypto").findMember;
139
+ currentSigningKey: typeof import("@oxy.so/core/crypto").currentSigningKey;
140
+ currentBoxKey: typeof import("@oxy.so/core/crypto").currentBoxKey;
141
+ createKeyring: typeof import("@oxy.so/core/crypto").createKeyring;
142
+ rotateKeyring: typeof import("@oxy.so/core/crypto").rotateKeyring;
143
+ zeroizeKeyring: typeof import("@oxy.so/core/crypto").zeroizeKeyring;
144
+ vaultKeyOf: typeof import("@oxy.so/core/crypto").vaultKeyOf;
145
+ encodeKeyring: typeof import("@oxy.so/core/crypto").encodeKeyring;
146
+ decodeKeyring: typeof import("@oxy.so/core/crypto").decodeKeyring;
147
+ wrapAad: typeof import("@oxy.so/core/crypto").wrapAad;
148
+ wrapSigningInput: typeof import("@oxy.so/core/crypto").wrapSigningInput;
149
+ parseWrap: typeof import("@oxy.so/core/crypto").parseWrap;
150
+ createWrap: typeof import("@oxy.so/core/crypto").createWrap;
151
+ verifyWrap: typeof import("@oxy.so/core/crypto").verifyWrap;
152
+ openWrap: typeof import("@oxy.so/core/crypto").openWrap;
153
+ generateEnrollmentNonce: typeof import("@oxy.so/core/crypto").generateEnrollmentNonce;
154
+ enrollmentCommitInput: typeof import("@oxy.so/core/crypto").enrollmentCommitInput;
155
+ enrollmentCommitment: typeof import("@oxy.so/core/crypto").enrollmentCommitment;
156
+ verifyEnrollmentCommitment: typeof import("@oxy.so/core/crypto").verifyEnrollmentCommitment;
157
+ enrollmentCodeInput: typeof import("@oxy.so/core/crypto").enrollmentCodeInput;
158
+ enrollmentComparisonCode: typeof import("@oxy.so/core/crypto").enrollmentComparisonCode;
159
+ WIFI_SECURITY: readonly ["wpa2-psk", "wpa3-sae", "wep", "open"];
160
+ validateItem: typeof import("@oxy.so/core/crypto").validateItem;
161
+ padItemPlaintext: typeof import("@oxy.so/core/crypto").padItemPlaintext;
162
+ encodeItemPlaintext: typeof import("@oxy.so/core/crypto").encodeItemPlaintext;
163
+ decodeItemPlaintext: typeof import("@oxy.so/core/crypto").decodeItemPlaintext;
164
+ itemAad: typeof import("@oxy.so/core/crypto").itemAad;
165
+ encryptItem: typeof import("@oxy.so/core/crypto").encryptItem;
166
+ decryptItem: typeof import("@oxy.so/core/crypto").decryptItem;
167
+ isItemCounterAcceptable: typeof import("@oxy.so/core/crypto").isItemCounterAcceptable;
168
+ nextItemCounter: typeof import("@oxy.so/core/crypto").nextItemCounter;
169
+ generateStrongPassword: typeof import("@oxy.so/core/crypto").generateStrongPassword;
170
+ isStrongPasswordShape: typeof import("@oxy.so/core/crypto").isStrongPasswordShape;
171
+ decodeBase32Secret: typeof import("@oxy.so/core/crypto").decodeBase32Secret;
172
+ encodeBase32Secret: typeof import("@oxy.so/core/crypto").encodeBase32Secret;
173
+ hotpCode: typeof import("@oxy.so/core/crypto").hotpCode;
174
+ totpCounter: typeof import("@oxy.so/core/crypto").totpCounter;
175
+ totpCode: typeof import("@oxy.so/core/crypto").totpCode;
176
+ totpSecondsRemaining: typeof import("@oxy.so/core/crypto").totpSecondsRemaining;
177
+ parseOtpauthUri: typeof import("@oxy.so/core/crypto").parseOtpauthUri;
178
+ KeychainClient: typeof import("@oxy.so/core/crypto").KeychainClient;
91
179
  }>;
92
180
  //# sourceMappingURL=identityCrypto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"identityCrypto.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/identityCrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
1
+ {"version":3,"file":"identityCrypto.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/identityCrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * What kind of device an Oxy sign-in runs on. The sign-in screen and its
3
+ * Commons delivery decide by it (`resolveSignInMethods`,
4
+ * `resolveDeliveryPlatform`):
5
+ *
6
+ * - `browser` — react-native-web in a browser, on a phone or a computer
7
+ * (`resolveDeliveryPlatform` tells those apart);
8
+ * - `phone` — a native app on a phone or tablet (iOS, Android): the device
9
+ * Commons lives on, and the one that scans a QR;
10
+ * - `computer` — a native app on a computer (react-native-macos, OxyOS, any
11
+ * other desktop platform): no Commons to continue with and no
12
+ * camera to scan with. Like a browser on a computer, it SHOWS
13
+ * the QR a phone scans.
14
+ *
15
+ * A native platform is a phone only by name (`ios`, `android`); every other
16
+ * one is a computer, so a desktop platform the SDK does not know yet gets the
17
+ * QR rather than a "Continue with Oxy" that has nowhere to go.
18
+ */
19
+ export type SignInDevice = 'browser' | 'phone' | 'computer';
20
+ export declare function resolveSignInDevice(): SignInDevice;
21
+ //# sourceMappingURL=signInDevice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signInDevice.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/signInDevice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAE5D,wBAAgB,mBAAmB,IAAI,YAAY,CAGlD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/services",
3
- "version": "14.14.0",
3
+ "version": "14.15.1",
4
4
  "description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -176,14 +176,14 @@
176
176
  "delete-dts.js": "find ./lib/commonjs ./lib/module \\( -name '*.d.js*' -o -name '*.d.ts' \\) -delete"
177
177
  },
178
178
  "dependencies": {
179
- "@oxy.so/contracts": "^6.14.0",
179
+ "@oxy.so/contracts": "^6.20.0",
180
180
  "color": "^5.0.3",
181
181
  "@peable.to/sdk": "^4.0.0"
182
182
  },
183
183
  "devDependencies": {
184
184
  "@expo/app-integrity": "~58.0.2",
185
185
  "@expo/vector-icons": "^15.1.1",
186
- "@oxy.so/core": "7.38.0",
186
+ "@oxy.so/core": "7.44.0",
187
187
  "@react-native-async-storage/async-storage": "^3.1.1",
188
188
  "@react-native-community/netinfo": "^12.0.1",
189
189
  "@react-native/babel-preset": "^0.88.1",
package/src/index.ts CHANGED
@@ -390,6 +390,15 @@ export type {
390
390
  AccountDialogMenuSection,
391
391
  } from './ui/navigation/accountDialogManager';
392
392
 
393
+ // The account dialog's chooser without the dialog: the same sign-in (with the
394
+ // Commons QR from `md` on a browser or a computer), sign-up and request views,
395
+ // for a platform that shows it on a card of its own (OxyOS's login screen), its
396
+ // card sized by the chooser through `OxySurfaceFrame`.
397
+ export { default as OxyAuthChooser } from './ui/components/OxyAuthChooser';
398
+ export type { OxyAuthChooserProps } from './ui/components/OxyAuthChooser';
399
+ export { OxySurfaceFrame } from './ui/components/OxySurfaceFrame';
400
+ export type { OxySurfaceFrameProps } from './ui/components/OxySurfaceFrame';
401
+
393
402
  // THE sign-in screens. The account dialog renders them, and so does every page
394
403
  // of the auth.oxy.so IdP: one implementation of what a person sees when they
395
404
  // sign in, create an account, or choose which account continues.
@@ -86,8 +86,11 @@ export interface OxyAuthChooserProps {
86
86
 
87
87
  /**
88
88
  * The account switcher + sign-in/sign-up chooser. Mounted by `OxyAccountDialogScreen`
89
- * (wrapped in Bloom's `<Dialog>`) today; mountable bare by any future host that
90
- * supplies its own `onComplete`.
89
+ * (wrapped in Bloom's `<Dialog>`), and bare by a platform's own card
90
+ * (`OxySurfaceFrame`, OxyOS's login screen). `onComplete` reports what the
91
+ * chooser itself completes (a password or code sign-in, a sign-up, a switch); a
92
+ * sign-in the controller runs (the QR, "Continue with Oxy") completes through
93
+ * the provider, so a bare host follows the signed-in account.
91
94
  */
92
95
  const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
93
96
  const {
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A platform's own card around the account chooser (`OxyAuthChooser`), as the
3
+ * account dialog is the card around it in an app: OxyOS's login screen shows
4
+ * the SDK's sign-in on a card of its own (OxyOS ADR 0020, decision 4).
5
+ *
6
+ * Inside it the chooser's screens ask for the width their views need exactly as
7
+ * they ask the account dialog (`useSurfaceFrameWidth`: the sign-in's split card,
8
+ * with the Commons QR, asks for 880 from `md`; `null` when no longer needed).
9
+ * The platform sizes its card to the width asked, up to what its screen has.
10
+ */
11
+
12
+ import type React from 'react';
13
+ import { SurfaceFrameWidthContext } from '../hooks/useSurfaceFrameWidth';
14
+
15
+ export interface OxySurfaceFrameProps {
16
+ /** The width (px, the card's own padding included) a screen inside asks for; `null` for the card's own. */
17
+ onMaxWidthChange: (maxWidth: number | null) => void;
18
+ children: React.ReactNode;
19
+ }
20
+
21
+ export const OxySurfaceFrame: React.FC<OxySurfaceFrameProps> = ({ onMaxWidthChange, children }) => (
22
+ <SurfaceFrameWidthContext.Provider value={onMaxWidthChange}>
23
+ {children}
24
+ </SurfaceFrameWidthContext.Provider>
25
+ );
@@ -8,8 +8,10 @@
8
8
  * Continue. On the web, from `md`, the screen is Bloom `AuthCard`'s
9
9
  * split card and the Commons way in is the embedded QR over its
10
10
  * photo carousel, in the right column (the account dialog grows to
11
- * that card); below `md` it is "Continue with Oxy" at the top. On
12
- * native it is "Continue with Oxy" ("Get Commons" without Commons).
11
+ * that card); below `md` it is "Continue with Oxy" at the top. A
12
+ * native app on a computer (OxyOS, macOS) is the same as the web:
13
+ * it shows the QR a phone scans. On a phone it is "Continue with
14
+ * Oxy" ("Get Commons" without Commons).
13
15
  * check-email one email carries a code and a link. The code is typed here: 6
14
16
  * digits, or — "Does your code have letters?" — the 10-character
15
17
  * long code an account past its daily guessing ceiling is sent
@@ -59,7 +61,7 @@ import { useDeviceSwitcher } from '../../hooks/useDeviceSwitcher';
59
61
  import { useI18n } from '../../hooks/useI18n';
60
62
  import { useSurfaceFrameWidth } from '../../hooks/useSurfaceFrameWidth';
61
63
  import { getCommonsAcquisitionUrl } from '../../utils/commonsStoreLinks';
62
- import { isWebBrowser } from '../../utils/isWebBrowser';
64
+ import { resolveSignInDevice } from '../../utils/signInDevice';
63
65
  import { SubtleLink } from '../authChooser/primitives';
64
66
  import { SIGN_IN_SLIDES } from './artwork';
65
67
  import { InlineCommonsQr } from './InlineCommonsQr';
@@ -150,8 +152,9 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
150
152
  const snapshot = useAccountDialogSnapshot(controller);
151
153
  const { principals, activeContext } = useDeviceSwitcher();
152
154
 
155
+ const device = resolveSignInDevice();
153
156
  const methods = resolveSignInMethods({
154
- web: isWebBrowser(),
157
+ device,
155
158
  commonsAvailability: snapshot.commonsAvailability,
156
159
  });
157
160
 
@@ -826,7 +829,7 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
826
829
  autoComplete="username"
827
830
  keyboardType="email-address"
828
831
  maxLength={SIGN_IN_IDENTIFIER_MAX_LENGTH}
829
- autoFocus={Platform.OS === 'web'}
832
+ autoFocus={device !== 'phone'}
830
833
  testID="signin-identifier"
831
834
  />
832
835
  <Text style={[styles.note, styles.noAccount, { color: theme.colors.textSecondary }]}>
@@ -1,21 +1,24 @@
1
1
  /**
2
- * Which Commons way in a sign-in surface offers, from where it runs. Every
3
- * surface also takes an email or username (`OxySignInPanel`), in place:
2
+ * Which Commons way in a sign-in surface offers, from the device it runs on
3
+ * (`resolveSignInDevice`). Every surface also takes an email or username
4
+ * (`OxySignInPanel`), in place:
4
5
  *
5
- * - the web: the embedded QR (the split card's right column from `md`, with
6
- * "Continue with Oxy" below `md`, where the screen is the phone that would
7
- * scan it);
8
- * - native: "Continue with Oxy", and "Get Commons" on a device that has no
6
+ * - a browser or a computer: the embedded QR a phone scans (the split card's
7
+ * right column from `md`, with "Continue with Oxy" below `md`, where the
8
+ * screen is as narrow as a phone's);
9
+ * - a phone: "Continue with Oxy", and "Get Commons" on a phone that has no
9
10
  * Commons to continue with.
10
11
  */
11
12
 
12
13
  import type { CommonsAvailability } from '@oxy.so/core/session';
14
+ import type { SignInDevice } from '../../utils/signInDevice';
13
15
 
14
16
  /**
15
- * `qr` — the web: the embedded QR from `md`, "Continue with Oxy" below.
16
- * `continue` — native "Continue with Oxy": Oxy picks the route (shared
17
+ * `qr` — a browser or a computer: the embedded QR from `md`,
18
+ * "Continue with Oxy" below.
19
+ * `continue` — a phone's "Continue with Oxy": Oxy picks the route (shared
17
20
  * keychain, Commons on this device, a push, or the QR view).
18
- * `get-commons` — native, and Commons is not installed here.
21
+ * `get-commons` — a phone, and Commons is not installed on it.
19
22
  */
20
23
  export type CommonsEntry = 'qr' | 'continue' | 'get-commons';
21
24
 
@@ -24,13 +27,13 @@ export interface SignInMethods {
24
27
  }
25
28
 
26
29
  export interface SignInSurfaceFacts {
27
- /** Rendering in a browser (react-native-web), not a native app. */
28
- web: boolean;
29
- /** The controller's native probe for an installed Commons. */
30
+ /** What the surface runs on (`resolveSignInDevice`). */
31
+ device: SignInDevice;
32
+ /** The controller's native probe for an installed Commons (phones only). */
30
33
  commonsAvailability: CommonsAvailability;
31
34
  }
32
35
 
33
36
  export function resolveSignInMethods(facts: SignInSurfaceFacts): SignInMethods {
34
- if (facts.web) return { commons: 'qr' };
37
+ if (facts.device !== 'phone') return { commons: 'qr' };
35
38
  return { commons: facts.commonsAvailability === 'unavailable' ? 'get-commons' : 'continue' };
36
39
  }
@@ -62,6 +62,7 @@ import {
62
62
  import { isWebBrowser } from '../utils/isWebBrowser';
63
63
  import { loadIdentityCrypto } from '../utils/identityCrypto';
64
64
  import { resolveDeliveryPlatform } from '../utils/deliveryPlatform';
65
+ import { resolveSignInDevice } from '../utils/signInDevice';
65
66
  import { runProviderColdBoot } from '../boot/runProviderColdBoot';
66
67
  import { resolveApplicationSessionLane } from '../oauth/applicationSessionLane';
67
68
  import { handleAuthError } from '../utils/errorHandlers';
@@ -719,6 +720,17 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
719
720
  clearingInvalidTokenRef.current = true;
720
721
  try {
721
722
  await clearSessionStateRef.current();
723
+ // A platform's setup client (`authStateStore`) handed its credential to
724
+ // the platform and keeps none, so once its session is over it holds no
725
+ // device either: the device's state and directory go with the session.
726
+ // Kept, the directory went on listing the account the setup had just
727
+ // lost, and the sign-in offered it as "Choose an account" — a device
728
+ // picker on a screen that is not a device's (OxyOS's login screen lists
729
+ // its own accounts) and that could only start the same sign-in again.
730
+ if (!usesSharedDeviceCredential) {
731
+ sessionClient.resetLocalState();
732
+ sessionClientHost.setDeviceCredential(null);
733
+ }
722
734
  } catch (clearError) {
723
735
  logger('Failed to clear invalidated auth session', clearError);
724
736
  } finally {
@@ -777,7 +789,16 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
777
789
  unsubscribe();
778
790
  recovery.dispose();
779
791
  };
780
- }, [logger, oxyServices, runtime, sessionClient, authStore, identity]);
792
+ }, [
793
+ logger,
794
+ oxyServices,
795
+ runtime,
796
+ sessionClient,
797
+ sessionClientHost,
798
+ authStore,
799
+ identity,
800
+ usesSharedDeviceCredential,
801
+ ]);
781
802
 
782
803
  // Unified in-session refresh (SDK-owned; every RP inherits it). Installs the
783
804
  // ONE core refresh handler (re-mint from the persisted zero-cookie device
@@ -1095,12 +1116,12 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1095
1116
  }
1096
1117
  void Linking.openURL(url);
1097
1118
  },
1098
- // Native-only probe so the controller can detect an installed Commons and
1119
+ // A phone's probe so the controller can detect an installed Commons and
1099
1120
  // deep-link straight into its approve screen (keeping the QR/polling live
1100
1121
  // as fallback). `undefined` on web mirrors the `openUrl` split — the
1101
1122
  // controller short-circuits, so `redirectToAuthorize` never runs for the
1102
- // `oxycommons://` payload.
1103
- canOpenApp: isWebBrowser() ? undefined : (url) => Linking.canOpenURL(url),
1123
+ // `oxycommons://` payload — and on a computer, which Commons never runs on.
1124
+ canOpenApp: resolveSignInDevice() === 'phone' ? (url) => Linking.canOpenURL(url) : undefined,
1104
1125
  // Which surface a sign-in starts from — a FACT only this consumer can
1105
1126
  // supply (headless core never touches a platform global). It decides
1106
1127
  // whether automatic delivery may take the same-device Commons deep link;
@@ -7,6 +7,9 @@ import { createContext, useContext, useLayoutEffect } from 'react';
7
7
  * a screen whose views need different widths (the account dialog: the 420 menu,
8
8
  * the sign-in's 880 split card) hands its width to that host rather than
9
9
  * declaring a second frame. A change morphs the centered card to it.
10
+ *
11
+ * A platform that shows the account chooser on a card of its own (OxyOS's
12
+ * login screen, `OxySurfaceFrame`) provides it too: that card is the surface.
10
13
  */
11
14
  export const SurfaceFrameWidthContext = createContext<((maxWidth: number | null) => void) | null>(
12
15
  null,
@@ -20,7 +20,7 @@
20
20
  */
21
21
 
22
22
  import type { CommonsDeliveryPlatform } from '@oxy.so/core';
23
- import { isWebBrowser } from './isWebBrowser';
23
+ import { resolveSignInDevice } from './signInDevice';
24
24
 
25
25
  /**
26
26
  * The `navigator.userAgentData` slice this module reads. Declared locally
@@ -39,15 +39,19 @@ type NavigatorWithUserAgentData = Navigator & {
39
39
  /**
40
40
  * Which surface this app is running on, as `selectCommonsDelivery` models it.
41
41
  *
42
- * - Native (Expo/RN) is always `'mobile'`: it is an Oxy app installed on a
43
- * phone/tablet, exactly the case where a verified Commons link can resolve
42
+ * - A native app on a phone or tablet (`resolveSignInDevice`: iOS, Android)
43
+ * is `'mobile'`: exactly the case where a verified Commons link can resolve
44
44
  * on this very device.
45
+ * - A native app on a computer (react-native-macos, OxyOS) is `'desktop'`:
46
+ * Commons is a phone's, so no link to it resolves here.
45
47
  * - A web browser is classified from the signals above.
46
48
  * - Anything else — a browser-like environment with neither signal — is
47
49
  * `'unknown'`, a first-class value that never opts into the deep link.
48
50
  */
49
51
  export function resolveDeliveryPlatform(): CommonsDeliveryPlatform {
50
- if (!isWebBrowser()) return 'mobile';
52
+ const device = resolveSignInDevice();
53
+ if (device === 'phone') return 'mobile';
54
+ if (device === 'computer') return 'desktop';
51
55
 
52
56
  const nav: NavigatorWithUserAgentData | undefined =
53
57
  typeof navigator === 'undefined' ? undefined : navigator;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * What kind of device an Oxy sign-in runs on. The sign-in screen and its
3
+ * Commons delivery decide by it (`resolveSignInMethods`,
4
+ * `resolveDeliveryPlatform`):
5
+ *
6
+ * - `browser` — react-native-web in a browser, on a phone or a computer
7
+ * (`resolveDeliveryPlatform` tells those apart);
8
+ * - `phone` — a native app on a phone or tablet (iOS, Android): the device
9
+ * Commons lives on, and the one that scans a QR;
10
+ * - `computer` — a native app on a computer (react-native-macos, OxyOS, any
11
+ * other desktop platform): no Commons to continue with and no
12
+ * camera to scan with. Like a browser on a computer, it SHOWS
13
+ * the QR a phone scans.
14
+ *
15
+ * A native platform is a phone only by name (`ios`, `android`); every other
16
+ * one is a computer, so a desktop platform the SDK does not know yet gets the
17
+ * QR rather than a "Continue with Oxy" that has nowhere to go.
18
+ */
19
+
20
+ import { Platform } from 'react-native';
21
+ import { isWebBrowser } from './isWebBrowser';
22
+
23
+ export type SignInDevice = 'browser' | 'phone' | 'computer';
24
+
25
+ export function resolveSignInDevice(): SignInDevice {
26
+ if (isWebBrowser()) return 'browser';
27
+ return Platform.OS === 'ios' || Platform.OS === 'android' ? 'phone' : 'computer';
28
+ }