@oxy.so/services 14.15.0 → 14.15.2

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 (71) hide show
  1. package/lib/commonjs/index.js.map +1 -1
  2. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +27 -2
  3. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -1
  4. package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js +3 -1
  5. package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js.map +1 -1
  6. package/lib/commonjs/ui/components/signIn/ReauthStep.js +21 -0
  7. package/lib/commonjs/ui/components/signIn/ReauthStep.js.map +1 -1
  8. package/lib/commonjs/ui/context/OxyContext.js +30 -6
  9. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  10. package/lib/commonjs/ui/session/deviceCredentialTracker.js +4 -2
  11. package/lib/commonjs/ui/session/deviceCredentialTracker.js.map +1 -1
  12. package/lib/commonjs/ui/session/setupSignIn.js +6 -0
  13. package/lib/commonjs/ui/session/setupSignIn.js.map +1 -0
  14. package/lib/module/index.js +0 -1
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/module/ui/components/signIn/OxySignInPanel.js +27 -2
  17. package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -1
  18. package/lib/module/ui/components/signIn/OxySignUpPanel.js +3 -1
  19. package/lib/module/ui/components/signIn/OxySignUpPanel.js.map +1 -1
  20. package/lib/module/ui/components/signIn/ReauthStep.js +22 -1
  21. package/lib/module/ui/components/signIn/ReauthStep.js.map +1 -1
  22. package/lib/module/ui/context/OxyContext.js +30 -6
  23. package/lib/module/ui/context/OxyContext.js.map +1 -1
  24. package/lib/module/ui/session/deviceCredentialTracker.js +4 -2
  25. package/lib/module/ui/session/deviceCredentialTracker.js.map +1 -1
  26. package/lib/module/ui/session/setupSignIn.js +4 -0
  27. package/lib/module/ui/session/setupSignIn.js.map +1 -0
  28. package/lib/typescript/commonjs/index.d.ts +1 -0
  29. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
  31. package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts +2 -1
  32. package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts.map +1 -1
  33. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +10 -3
  35. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/ui/icons/Ionicons.d.ts +1 -1
  37. package/lib/typescript/commonjs/ui/session/deviceCredentialTracker.d.ts +3 -12
  38. package/lib/typescript/commonjs/ui/session/deviceCredentialTracker.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/ui/session/setupSignIn.d.ts +38 -0
  40. package/lib/typescript/commonjs/ui/session/setupSignIn.d.ts.map +1 -0
  41. package/lib/typescript/commonjs/ui/types/navigation.d.ts +7 -3
  42. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts +81 -0
  44. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts.map +1 -1
  45. package/lib/typescript/module/index.d.ts +1 -0
  46. package/lib/typescript/module/index.d.ts.map +1 -1
  47. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
  48. package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts +2 -1
  49. package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts.map +1 -1
  50. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  51. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +10 -3
  52. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  53. package/lib/typescript/module/ui/icons/Ionicons.d.ts +1 -1
  54. package/lib/typescript/module/ui/session/deviceCredentialTracker.d.ts +3 -12
  55. package/lib/typescript/module/ui/session/deviceCredentialTracker.d.ts.map +1 -1
  56. package/lib/typescript/module/ui/session/setupSignIn.d.ts +38 -0
  57. package/lib/typescript/module/ui/session/setupSignIn.d.ts.map +1 -0
  58. package/lib/typescript/module/ui/types/navigation.d.ts +7 -3
  59. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  60. package/lib/typescript/module/ui/utils/identityCrypto.d.ts +81 -0
  61. package/lib/typescript/module/ui/utils/identityCrypto.d.ts.map +1 -1
  62. package/package.json +3 -3
  63. package/src/index.ts +5 -0
  64. package/src/ui/components/signIn/OxySignInPanel.tsx +22 -2
  65. package/src/ui/components/signIn/OxySignUpPanel.tsx +1 -1
  66. package/src/ui/components/signIn/ReauthStep.tsx +26 -1
  67. package/src/ui/context/OxyContext.tsx +47 -6
  68. package/src/ui/context/oxyContextTypes.ts +11 -3
  69. package/src/ui/session/deviceCredentialTracker.ts +10 -5
  70. package/src/ui/session/setupSignIn.ts +41 -0
  71. package/src/ui/types/navigation.ts +7 -3
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAkC,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAA+B,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,OAAO,CAAC;IACz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CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD"}
@@ -95,5 +95,86 @@ export declare const loadIdentityCrypto: () => Promise<{
95
95
  loadCommonsIdentityBridge: typeof import("@oxy.so/protocol").loadCommonsIdentityBridge;
96
96
  signMessage: typeof import("@oxy.so/protocol").signMessage;
97
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;
98
179
  }>;
99
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/services",
3
- "version": "14.15.0",
3
+ "version": "14.15.2",
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.19.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.42.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
@@ -84,6 +84,11 @@ export { IdentityBoundSessionError } from './ui/session/identityBinding';
84
84
  // Thrown by an operation that a platform holding the session (a session host,
85
85
  // ADR 0058) does itself: a sign-in this app would commit, device management.
86
86
  export { HostedSessionError } from './ui/session/hostSession';
87
+ export type {
88
+ PlatformSetupAuthStateStore,
89
+ SetupSignInContext,
90
+ SetupSignInMethod,
91
+ } from './ui/session/setupSignIn';
87
92
 
88
93
  // ---------------------------------------------------------------------------
89
94
  // Zustand stores
@@ -78,6 +78,7 @@ import {
78
78
  isCompleteSignInCode,
79
79
  } from './accountFlowParts';
80
80
  import { readSignInFlow, writeSignInFlow } from './signInFlowStore';
81
+ import type { SetupSignInContext } from '../../session/setupSignIn';
81
82
  import { resolveSignInMethods } from './signInMethods';
82
83
  import { describeApiError, errorCode, retryAfterSeconds } from '../../utils/apiErrorMessage';
83
84
  import { withoutWhitespace } from '../../utils/withoutWhitespace';
@@ -244,6 +245,16 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
244
245
 
245
246
  // One sign-in ends once: the typed code and the opened link can race.
246
247
  const finishingRef = useRef(false);
248
+ // How this sign-in's first factor went, for a platform's setup store
249
+ // (`SetupSignInContext`): kept only until the sign-in commits or fails, so
250
+ // the password typed is held no longer than the request that uses it.
251
+ const firstFactorRef = useRef<SetupSignInContext | null>(null);
252
+ useEffect(
253
+ () => () => {
254
+ firstFactorRef.current = null;
255
+ },
256
+ [],
257
+ );
247
258
  const finish = useCallback(
248
259
  async (
249
260
  result: EmailSignInStepResult,
@@ -273,8 +284,10 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
273
284
  }
274
285
  finishingRef.current = true;
275
286
  writeSignInFlow(flowOwner, SIGN_IN_FLOW_KEY, undefined);
287
+ const setup = firstFactorRef.current ?? undefined;
288
+ firstFactorRef.current = null;
276
289
  try {
277
- await handleWebSession(result as LoginResult);
290
+ await handleWebSession(result as LoginResult, setup);
278
291
  } catch (reason) {
279
292
  finishingRef.current = false;
280
293
  throw reason;
@@ -332,6 +345,7 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
332
345
  setError(null);
333
346
  setNotice(null);
334
347
  setPending(true);
348
+ firstFactorRef.current = { method: 'emailCode' };
335
349
  oxyServices.auth.email
336
350
  .confirm({
337
351
  requestId: request.requestId,
@@ -353,6 +367,7 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
353
367
  setError(null);
354
368
  setPending(true);
355
369
  setChoosingId(account.id);
370
+ firstFactorRef.current = { method: 'emailCode' };
356
371
  oxyServices.auth.email
357
372
  .choose({
358
373
  requestId: request.requestId,
@@ -376,10 +391,14 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
376
391
  const name = step.identifier;
377
392
  setError(null);
378
393
  setPending(true);
394
+ firstFactorRef.current = { method: 'password', password };
379
395
  oxyServices.auth.password
380
396
  .signIn({ identifier: name, password })
381
397
  .then((result) => finish(result, name))
382
- .catch(fail)
398
+ .catch((reason: unknown) => {
399
+ firstFactorRef.current = null;
400
+ fail(reason);
401
+ })
383
402
  .finally(() => setPending(false));
384
403
  };
385
404
 
@@ -427,6 +446,7 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
427
446
  try {
428
447
  const result = await oxyServices.auth.email.collect({ requestId, requestSecret });
429
448
  if (!('status' in result)) {
449
+ firstFactorRef.current = { method: 'emailCode' };
430
450
  await finishRef.current(result, requestIdentifier, { requestId, requestSecret });
431
451
  return;
432
452
  }
@@ -166,7 +166,7 @@ export const OxySignUpPanel: React.FC<OxySignUpPanelProps> = ({
166
166
  languages: [currentLanguage],
167
167
  ...(campaignAttribution ? { campaignAttribution } : {}),
168
168
  });
169
- await handleWebSession(session);
169
+ await handleWebSession(session, { method: 'signup' });
170
170
  writeSignInFlow(flowOwner, SIGN_UP_FLOW_KEY, undefined);
171
171
  } catch (reason) {
172
172
  if (errorCode(reason) === SIGN_IN_ERROR_CODES.usernameTaken) {
@@ -38,7 +38,8 @@ export interface ReauthStepProps {
38
38
  allowPassword?: boolean;
39
39
  /**
40
40
  * The account has an email, and this change accepts a code sent to it.
41
- * Without it the proof is the password alone.
41
+ * Without it the proof is the password alone; with neither, the change is
42
+ * not offered (there is no proof the account could give).
42
43
  */
43
44
  allowEmail?: boolean;
44
45
  /** The account has an authenticator: its code is required too. */
@@ -137,6 +138,30 @@ export const ReauthStep: React.FC<ReauthStepProps> = ({
137
138
 
138
139
  const needsCode = mode === 'email' && !verificationId;
139
140
 
141
+ // No proof this account can give: no email to send a code to, and no password
142
+ // this change accepts. Offering either anyway sends a code nowhere or asks for
143
+ // a password that does not exist, so the change is not offered at all; the
144
+ // account needs an email first (the API refuses both, `reauth.service`).
145
+ if (!allowPassword && !allowEmail) {
146
+ return (
147
+ <OxyAuthScreen>
148
+ <OxyAuthScreenHeader title={title} />
149
+ <AccountFlowNote>{t('signInSecurity.email.noneDescription')}</AccountFlowNote>
150
+ {secondary ? (
151
+ <Button
152
+ appearance="plain"
153
+ tone="neutral"
154
+ size="lg"
155
+ onPress={secondary.onPress}
156
+ testID="reauth-cancel"
157
+ >
158
+ {secondary.label}
159
+ </Button>
160
+ ) : null}
161
+ </OxyAuthScreen>
162
+ );
163
+ }
164
+
140
165
  return (
141
166
  <OxyAuthScreen>
142
167
  <OxyAuthScreenHeader title={title} description={description} />
@@ -120,6 +120,7 @@ import {
120
120
  useBackgroundSessionSync,
121
121
  type IdentitySessionBinding,
122
122
  } from '../session';
123
+ import type { SetupSignInContext } from '../session/setupSignIn';
123
124
  import type { OxyContextState, OxyRuntimeProviderProps, CommitInput } from './oxyContextTypes';
124
125
  import { DEFAULT_SESSION_VALIDITY_MS } from './oxyContextHelpers';
125
126
  import { useFollow } from '../hooks/useFollow';
@@ -720,6 +721,17 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
720
721
  clearingInvalidTokenRef.current = true;
721
722
  try {
722
723
  await clearSessionStateRef.current();
724
+ // A platform's setup client (`authStateStore`) handed its credential to
725
+ // the platform and keeps none, so once its session is over it holds no
726
+ // device either: the device's state and directory go with the session.
727
+ // Kept, the directory went on listing the account the setup had just
728
+ // lost, and the sign-in offered it as "Choose an account" — a device
729
+ // picker on a screen that is not a device's (OxyOS's login screen lists
730
+ // its own accounts) and that could only start the same sign-in again.
731
+ if (!usesSharedDeviceCredential) {
732
+ sessionClient.resetLocalState();
733
+ sessionClientHost.setDeviceCredential(null);
734
+ }
723
735
  } catch (clearError) {
724
736
  logger('Failed to clear invalidated auth session', clearError);
725
737
  } finally {
@@ -778,7 +790,16 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
778
790
  unsubscribe();
779
791
  recovery.dispose();
780
792
  };
781
- }, [logger, oxyServices, runtime, sessionClient, authStore, identity]);
793
+ }, [
794
+ logger,
795
+ oxyServices,
796
+ runtime,
797
+ sessionClient,
798
+ sessionClientHost,
799
+ authStore,
800
+ identity,
801
+ usesSharedDeviceCredential,
802
+ ]);
782
803
 
783
804
  // Unified in-session refresh (SDK-owned; every RP inherits it). Installs the
784
805
  // ONE core refresh handler (re-mint from the persisted zero-cookie device
@@ -827,7 +848,15 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
827
848
  // Used by the QR device flow (`handleWebSession`), password sign-in, 2FA
828
849
  // completion, and the cold boot.
829
850
  const commitSession = useCallback(
830
- async (input: CommitInput, options: { activate: boolean; oauth?: boolean }): Promise<void> => {
851
+ async (
852
+ input: CommitInput,
853
+ options: {
854
+ activate: boolean;
855
+ oauth?: boolean;
856
+ /** How the sign-in happened, for a platform's setup store only. */
857
+ setup?: SetupSignInContext;
858
+ },
859
+ ): Promise<void> => {
831
860
  const isolatedOAuth = options.oauth === true && !input.deviceId && !input.deviceSecret;
832
861
  if (isolatedOAuth || hasIsolatedOAuthSession(runtime)) {
833
862
  sessionClient.resetLocalState();
@@ -861,7 +890,13 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
861
890
  ...(input.accessToken ? { accessToken: input.accessToken } : {}),
862
891
  ...(input.expiresAt ? { expiresAt: input.expiresAt } : {}),
863
892
  };
864
- await authStore.save(next);
893
+ // A platform's setup store (`authStateStore`) is also told how the
894
+ // sign-in happened; the platform's own stores never are.
895
+ if (options.setup && !usesSharedDeviceCredential && authStoreRef.current) {
896
+ await authStoreRef.current.save(next, options.setup);
897
+ } else {
898
+ await authStore.save(next);
899
+ }
865
900
  sessionClientHost.setDeviceCredential({
866
901
  deviceId: input.deviceId,
867
902
  deviceSecret: input.deviceSecret,
@@ -942,6 +977,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
942
977
  logger,
943
978
  clientId,
944
979
  identity,
980
+ usesSharedDeviceCredential,
945
981
  ],
946
982
  );
947
983
  const commitSessionRef = useRef(commitSession);
@@ -950,7 +986,10 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
950
986
  // Public `handleWebSession`: commit a session from the QR device flow. It is a
951
987
  // deliberate sign-in on THIS device, so it activates the account.
952
988
  const handleWebSession = useCallback(
953
- async (session: SessionLoginResponse | LoginSessionResult): Promise<void> => {
989
+ async (
990
+ session: SessionLoginResponse | LoginSessionResult,
991
+ setup?: SetupSignInContext,
992
+ ): Promise<void> => {
954
993
  if (!session?.user || !session?.sessionId || !session.accessToken) {
955
994
  throw new Error('Session response did not include a usable session');
956
995
  }
@@ -964,7 +1003,7 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
964
1003
  userId: session.user.id,
965
1004
  user: session.user,
966
1005
  },
967
- { activate: true },
1006
+ { activate: true, ...(setup ? { setup } : {}) },
968
1007
  );
969
1008
  },
970
1009
  [commitSession],
@@ -1083,7 +1122,9 @@ export const OxyRuntimeProvider: React.FC<OxyRuntimeProviderProps> = ({
1083
1122
  oxyServices,
1084
1123
  sessionClient,
1085
1124
  clientId,
1086
- commitSession: (session) => handleWebSessionRef.current(session),
1125
+ // The controller's sign-ins are approvals from a device the person holds
1126
+ // (the QR, the Commons identity): passwordless.
1127
+ commitSession: (session) => handleWebSessionRef.current(session, { method: 'qr' }),
1087
1128
  onSignedIn: () => {
1088
1129
  // Close the dialog: pop the morphed frame back to its host surface, or
1089
1130
  // dismiss the detached surface (whose settle flips `accountDialogOpen`).
@@ -17,11 +17,11 @@ import type {
17
17
  import type {
18
18
  AccountDialogController,
19
19
  AccountDialogView,
20
- AuthStateStore,
21
20
  SessionClient,
22
21
  SessionMode,
23
22
  } from '@oxy.so/core/session';
24
23
  import type { UseFollowHook } from '../hooks/useFollow.types';
24
+ import type { PlatformSetupAuthStateStore, SetupSignInContext } from '../session/setupSignIn';
25
25
  import type { useLanguageManagement } from '../hooks/useLanguageManagement';
26
26
  import type { RouteName } from '../navigation/routes';
27
27
  import type { StartWebOAuthSignInOptions } from '../oauth/browserAuthTransport';
@@ -118,7 +118,15 @@ export interface OxyContextState {
118
118
  * code exchange, an email code or link, a password, a sign-up — as the
119
119
  * active one.
120
120
  */
121
- handleWebSession: (session: SessionLoginResponse | LoginSessionResult) => Promise<void>;
121
+ handleWebSession: (
122
+ session: SessionLoginResponse | LoginSessionResult,
123
+ /**
124
+ * How the sign-in happened, handed to a platform's setup store
125
+ * (`authStateStore`) with the credential, and to no other store
126
+ * (`SetupSignInContext`).
127
+ */
128
+ setup?: SetupSignInContext,
129
+ ) => Promise<void>;
122
130
 
123
131
  /**
124
132
  * Run a WEB third-party OAuth sign-in (authorization code + PKCE) end to end
@@ -259,7 +267,7 @@ export interface OxyRuntimeProviderProps {
259
267
  /** Storage instance owned by the public provider; internal composition seam. */
260
268
  platformStorage?: StorageInterface | null;
261
269
  /** See `OxyProviderProps.authStateStore`. Read once, at mount. */
262
- authStateStore?: AuthStateStore;
270
+ authStateStore?: PlatformSetupAuthStateStore;
263
271
  /** See `OxyProviderProps.accountQueries`. Read once, at mount. */
264
272
  accountQueries?: AccountQueriesConfig;
265
273
  }
@@ -7,14 +7,15 @@
7
7
  * every load, save and clear passes through, so the press can read it at once.
8
8
  * The cold boot loads the store on mount, long before anyone presses sign-in.
9
9
  */
10
- import type { AuthStateStore, AuthStateWriteGuard, PersistedAuthState } from '@oxy.so/core/session';
10
+ import type { AuthStateWriteGuard, PersistedAuthState } from '@oxy.so/core/session';
11
+ import type { PlatformSetupAuthStateStore, SetupSignInContext } from './setupSignIn';
11
12
 
12
13
  export interface HeldDeviceCredential {
13
14
  deviceId: string;
14
15
  deviceSecret: string;
15
16
  }
16
17
 
17
- export interface CredentialTrackingAuthStateStore extends AuthStateStore {
18
+ export interface CredentialTrackingAuthStateStore extends PlatformSetupAuthStateStore {
18
19
  /**
19
20
  * The credential last seen through this store; `undefined` until the store has
20
21
  * been read at least once (unknown — the caller should not guess).
@@ -30,7 +31,9 @@ function credentialOf(
30
31
  : null;
31
32
  }
32
33
 
33
- export function trackDeviceCredential(store: AuthStateStore): CredentialTrackingAuthStateStore {
34
+ export function trackDeviceCredential(
35
+ store: PlatformSetupAuthStateStore,
36
+ ): CredentialTrackingAuthStateStore {
34
37
  let held: HeldDeviceCredential | null | undefined;
35
38
  return {
36
39
  ...store,
@@ -39,9 +42,11 @@ export function trackDeviceCredential(store: AuthStateStore): CredentialTracking
39
42
  held = credentialOf(state);
40
43
  return state;
41
44
  },
42
- save: async (state) => {
45
+ // The setup context (how the sign-in happened) goes to the wrapped store
46
+ // only when the caller passed one, so a plain store sees its usual call.
47
+ save: async (state: PersistedAuthState, context?: SetupSignInContext) => {
43
48
  held = credentialOf(state);
44
- return store.save(state);
49
+ return context ? store.save(state, context) : store.save(state);
45
50
  },
46
51
  ...(store.saveIfCurrent
47
52
  ? {
@@ -0,0 +1,41 @@
1
+ /**
2
+ * What a platform's setup client is told about each sign-in it commits.
3
+ *
4
+ * A platform that runs the SDK's own sign-in at its setup (OxyOS's login
5
+ * screen) gives the provider its own store (`OxyProviderProps.authStateStore`),
6
+ * and `save()` receives the credential the moment a sign-in commits. The
7
+ * platform also needs to know HOW the person signed in, because its own setup
8
+ * differs:
9
+ *
10
+ * - `'qr'`: approved from a device the person already holds (the QR a phone
11
+ * scans, or the Commons identity): passwordless, so the platform asks no
12
+ * password; its service redeems the approval for its own credential
13
+ * (`POST /session/device/platform`, ADR 0058 R6);
14
+ * - `'password'`: the account's password, which the person just typed and the
15
+ * platform may reuse once (OxyOS keeps it as its offline verifier) instead of
16
+ * asking for it again; it is in `password`, with or without a second factor;
17
+ * - `'emailCode'`: the code or the link sent by email;
18
+ * - `'signup'`: a new account.
19
+ *
20
+ * Passed as `save()`'s second argument, and ONLY to a store the app provided:
21
+ * the platform's default stores never receive it. The SDK never keeps the
22
+ * password beyond handing it over, never persists it and never logs it.
23
+ */
24
+
25
+ import type { AuthStateStore, PersistedAuthState } from '@oxy.so/core/session';
26
+
27
+ export type SetupSignInMethod = 'qr' | 'password' | 'emailCode' | 'signup';
28
+
29
+ export interface SetupSignInContext {
30
+ method: SetupSignInMethod;
31
+ /** The password just typed; present only when `method` is `'password'`. */
32
+ password?: string;
33
+ }
34
+
35
+ /**
36
+ * A platform's setup store: an {@link AuthStateStore} whose `save()` may also
37
+ * read how the sign-in happened. Every `AuthStateStore` is one.
38
+ */
39
+ export interface PlatformSetupAuthStateStore extends Omit<AuthStateStore, 'save'> {
40
+ save(state: PersistedAuthState, context?: SetupSignInContext): Promise<boolean>;
41
+ }
@@ -4,7 +4,8 @@ import type { AccountQueriesConfig } from '../hooks/accountQueryPersistence';
4
4
  import type { RouteName } from '../navigation/routes';
5
5
  import type { User } from '@oxy.so/core';
6
6
  import type { ClientSession } from '@oxy.so/core';
7
- import type { AuthStateStore, SessionMode } from '@oxy.so/core/session';
7
+ import type { SessionMode } from '@oxy.so/core/session';
8
+ import type { PlatformSetupAuthStateStore } from '../session/setupSignIn';
8
9
  import type { WebAuthMode } from '../oauth/types';
9
10
  import type { ProductAnalytics } from '../analytics/productAnalytics';
10
11
 
@@ -200,13 +201,16 @@ export interface OxyProviderProps {
200
201
  * off) and no background credential (`backgroundSession` is ignored). The
201
202
  * email-code, password and authenticator sign-ins and the "add a password"
202
203
  * flow (ADR 0030) run as usual; `save()` receives the credential the moment
203
- * a sign-in commits, so the platform can take it over.
204
+ * a sign-in commits, so the platform can take it over, and, as its second
205
+ * argument, how the sign-in happened (`SetupSignInContext`: the QR's
206
+ * approval, a password with the password just typed, an email code, a
207
+ * sign-up). Only this store ever receives that context.
204
208
  *
205
209
  * Ordinary apps never pass it. Never combined with a session host: when a
206
210
  * platform has registered one (`@oxy.so/core/host`), the host wins and this
207
211
  * is ignored. Read once, at mount.
208
212
  */
209
- authStateStore?: AuthStateStore;
213
+ authStateStore?: PlatformSetupAuthStateStore;
210
214
  }
211
215
 
212
216
  export interface OxyLanguageConfig {