@oxy.so/services 6.0.0 → 6.1.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.
Files changed (125) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/index.js +32 -0
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/ui/components/OxyAuthChooser.js +1 -2
  5. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  6. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +1 -8
  7. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  8. package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
  9. package/lib/commonjs/ui/components/signIn/OxyCreateAccountPanel.js +236 -0
  10. package/lib/commonjs/ui/components/signIn/OxyCreateAccountPanel.js.map +1 -0
  11. package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js +114 -0
  12. package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -0
  13. package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +275 -0
  14. package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -0
  15. package/lib/commonjs/ui/components/signIn/OxyRecoverAccountPanel.js +170 -0
  16. package/lib/commonjs/ui/components/signIn/OxyRecoverAccountPanel.js.map +1 -0
  17. package/lib/commonjs/ui/components/signIn/accountFlowParts.js +244 -0
  18. package/lib/commonjs/ui/components/signIn/accountFlowParts.js.map +1 -0
  19. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  20. package/lib/commonjs/ui/context/passkeyFlow.js +22 -0
  21. package/lib/commonjs/ui/context/passkeyFlow.js.map +1 -1
  22. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +0 -23
  23. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  24. package/lib/commonjs/ui/screens/EditProfileScreen.js +0 -8
  25. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  26. package/lib/commonjs/ui/screens/ManageAccountScreen.js +3 -3
  27. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  28. package/lib/commonjs/ui/utils/accountDeletionHandoff.js +2 -2
  29. package/lib/commonjs/ui/utils/accountDeletionHandoff.js.map +1 -1
  30. package/lib/module/index.js +7 -0
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/ui/components/OxyAuthChooser.js +2 -3
  33. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  34. package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -8
  35. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  36. package/lib/module/ui/components/authChooser/types.js.map +1 -1
  37. package/lib/module/ui/components/signIn/OxyCreateAccountPanel.js +231 -0
  38. package/lib/module/ui/components/signIn/OxyCreateAccountPanel.js.map +1 -0
  39. package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js +109 -0
  40. package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -0
  41. package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +270 -0
  42. package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -0
  43. package/lib/module/ui/components/signIn/OxyRecoverAccountPanel.js +165 -0
  44. package/lib/module/ui/components/signIn/OxyRecoverAccountPanel.js.map +1 -0
  45. package/lib/module/ui/components/signIn/accountFlowParts.js +235 -0
  46. package/lib/module/ui/components/signIn/accountFlowParts.js.map +1 -0
  47. package/lib/module/ui/context/OxyContext.js.map +1 -1
  48. package/lib/module/ui/context/passkeyFlow.js +21 -0
  49. package/lib/module/ui/context/passkeyFlow.js.map +1 -1
  50. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -24
  51. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  52. package/lib/module/ui/screens/EditProfileScreen.js +0 -8
  53. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  54. package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
  55. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  56. package/lib/module/ui/utils/accountDeletionHandoff.js +2 -2
  57. package/lib/module/ui/utils/accountDeletionHandoff.js.map +1 -1
  58. package/lib/typescript/commonjs/index.d.ts +8 -0
  59. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +0 -5
  63. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/ui/components/signIn/OxyCreateAccountPanel.d.ts +24 -0
  65. package/lib/typescript/commonjs/ui/components/signIn/OxyCreateAccountPanel.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts +16 -0
  67. package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts +21 -0
  69. package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/ui/components/signIn/OxyRecoverAccountPanel.d.ts +20 -0
  71. package/lib/typescript/commonjs/ui/components/signIn/OxyRecoverAccountPanel.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts +60 -0
  73. package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +7 -1
  76. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/ui/context/passkeyFlow.d.ts +16 -1
  78. package/lib/typescript/commonjs/ui/context/passkeyFlow.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts +1 -1
  81. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  83. package/lib/typescript/module/index.d.ts +8 -0
  84. package/lib/typescript/module/index.d.ts.map +1 -1
  85. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  86. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  87. package/lib/typescript/module/ui/components/authChooser/types.d.ts +0 -5
  88. package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
  89. package/lib/typescript/module/ui/components/signIn/OxyCreateAccountPanel.d.ts +24 -0
  90. package/lib/typescript/module/ui/components/signIn/OxyCreateAccountPanel.d.ts.map +1 -0
  91. package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts +16 -0
  92. package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -0
  93. package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts +21 -0
  94. package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -0
  95. package/lib/typescript/module/ui/components/signIn/OxyRecoverAccountPanel.d.ts +20 -0
  96. package/lib/typescript/module/ui/components/signIn/OxyRecoverAccountPanel.d.ts.map +1 -0
  97. package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts +60 -0
  98. package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts.map +1 -0
  99. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  100. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +7 -1
  101. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  102. package/lib/typescript/module/ui/context/passkeyFlow.d.ts +16 -1
  103. package/lib/typescript/module/ui/context/passkeyFlow.d.ts.map +1 -1
  104. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  105. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +1 -1
  106. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  107. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  108. package/package.json +4 -4
  109. package/src/index.ts +11 -0
  110. package/src/ui/components/OxyAuthChooser.tsx +2 -3
  111. package/src/ui/components/authChooser/AccountsMenuView.tsx +0 -7
  112. package/src/ui/components/authChooser/types.ts +0 -5
  113. package/src/ui/components/signIn/OxyCreateAccountPanel.tsx +207 -0
  114. package/src/ui/components/signIn/OxyDeleteAccountPanel.tsx +106 -0
  115. package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +222 -0
  116. package/src/ui/components/signIn/OxyRecoverAccountPanel.tsx +154 -0
  117. package/src/ui/components/signIn/accountFlowParts.tsx +204 -0
  118. package/src/ui/context/OxyContext.tsx +2 -1
  119. package/src/ui/context/__tests__/passkeyFlow.test.ts +59 -1
  120. package/src/ui/context/oxyContextTypes.ts +7 -1
  121. package/src/ui/context/passkeyFlow.ts +28 -0
  122. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -27
  123. package/src/ui/screens/EditProfileScreen.tsx +0 -6
  124. package/src/ui/screens/ManageAccountScreen.tsx +3 -3
  125. package/src/ui/utils/accountDeletionHandoff.ts +2 -2
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Linking Commons to a passkey account (ADR 0029 D3), auth.oxy.so's
5
+ * `/link-commons`:
6
+ *
7
+ * QR → Commons scans and signs with its key → both screens show the same
8
+ * code → the person confirms here with the passkey → linked
9
+ *
10
+ * Afterwards the account is self-custodied: its root is the key Commons holds,
11
+ * its recovery email is deleted, and its phrase in Commons is how it gets back
12
+ * in. The passkey keeps signing in on the web. The page must be signed in as
13
+ * the account; the host renders sign-in first.
14
+ */
15
+
16
+ import { useCallback, useEffect, useRef, useState } from 'react';
17
+ import { ActivityIndicator, StyleSheet, View } from 'react-native';
18
+ import QRCode from 'react-native-qrcode-svg';
19
+ import { Button } from '@oxy.so/bloom/button';
20
+ import { useTheme } from '@oxy.so/bloom/theme';
21
+ import { Text } from '@oxy.so/bloom/typography';
22
+ import { deriveIdentityLinkCode } from '@oxy.so/core';
23
+ import { useOxy } from "../../context/OxyContext.js";
24
+ import { PASSKEY_UNSUPPORTED_MESSAGE } from "../../context/passkeyFlow.js";
25
+ import { useI18n } from "../../hooks/useI18n.js";
26
+ import { isPasskeySupported, runAuthenticationCeremony } from '../../../webauthn/passkeyClient';
27
+ import { OxyAuthScreen, OxyAuthScreenHeader } from "./OxyAuthScreen.js";
28
+ import { AccountFlowAction, AccountFlowErrorLine, AccountFlowNote, describeAccountFlowError } from "./accountFlowParts.js";
29
+
30
+ /** How often the page asks whether Commons has signed. */
31
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
32
+ export const IDENTITY_LINK_POLL_MS = 2000;
33
+
34
+ /** High-contrast, un-themed on purpose: scan reliability. */
35
+ const QR_PLATE_BG = '#FFFFFF';
36
+ const QR_FOREGROUND = '#000000';
37
+ const QR_SIZE = 200;
38
+ export const OxyLinkCommonsPanel = ({
39
+ onLinked
40
+ }) => {
41
+ const theme = useTheme();
42
+ const {
43
+ t
44
+ } = useI18n();
45
+ const {
46
+ user,
47
+ oxyServices
48
+ } = useOxy();
49
+ const [step, setStep] = useState({
50
+ name: 'opening'
51
+ });
52
+ const [pending, setPending] = useState(false);
53
+ const [error, setError] = useState(null);
54
+ const alreadyLinked = Boolean(user?.publicKey);
55
+ const open = useCallback(() => {
56
+ setError(null);
57
+ setStep({
58
+ name: 'opening'
59
+ });
60
+ oxyServices.createIdentityLink().then(link => setStep({
61
+ name: 'qr',
62
+ link
63
+ })).catch(reason => {
64
+ setError(describeAccountFlowError(reason, t));
65
+ setStep({
66
+ name: 'expired'
67
+ });
68
+ });
69
+ }, [oxyServices, t]);
70
+
71
+ // One request per visit, opened once the page knows the account has no root.
72
+ const opened = useRef(false);
73
+ useEffect(() => {
74
+ if (alreadyLinked || opened.current) return;
75
+ opened.current = true;
76
+ open();
77
+ }, [alreadyLinked, open]);
78
+
79
+ // While the QR shows, ask whether Commons has signed; a request only lives a
80
+ // few minutes, and an expired one says so instead of waiting forever.
81
+ const link = step.name === 'qr' ? step.link : null;
82
+ useEffect(() => {
83
+ if (!link) return;
84
+ let stopped = false;
85
+ const poll = async () => {
86
+ if (stopped) return;
87
+ if (Date.now() >= link.expiresAt) {
88
+ setStep({
89
+ name: 'expired'
90
+ });
91
+ return;
92
+ }
93
+ try {
94
+ const state = await oxyServices.getIdentityLink(link.linkId);
95
+ if (stopped) return;
96
+ if (state.status === 'signed' && state.publicKey) {
97
+ setStep({
98
+ name: 'matching',
99
+ link,
100
+ code: deriveIdentityLinkCode(link.linkId, state.publicKey)
101
+ });
102
+ return;
103
+ }
104
+ if (state.status === 'cancelled') {
105
+ setStep({
106
+ name: 'expired'
107
+ });
108
+ return;
109
+ }
110
+ } catch {
111
+ // A missed poll is retried on the next tick.
112
+ }
113
+ if (!stopped) timer = setTimeout(() => void poll(), IDENTITY_LINK_POLL_MS);
114
+ };
115
+ let timer = setTimeout(() => void poll(), IDENTITY_LINK_POLL_MS);
116
+ return () => {
117
+ stopped = true;
118
+ clearTimeout(timer);
119
+ };
120
+ }, [link, oxyServices]);
121
+
122
+ // The ceremony opens the browser's passkey prompt, so it starts from the press.
123
+ const confirm = confirmed => {
124
+ if (pending) return;
125
+ setError(null);
126
+ setPending(true);
127
+ (async () => {
128
+ if (!isPasskeySupported()) throw new Error(PASSKEY_UNSUPPORTED_MESSAGE);
129
+ const options = await oxyServices.getIdentityLinkAssertionOptions(confirmed.linkId, confirmed.challenge);
130
+ const assertion = await runAuthenticationCeremony(options);
131
+ await oxyServices.completeIdentityLink(confirmed.linkId, assertion);
132
+ setStep({
133
+ name: 'done'
134
+ });
135
+ onLinked?.();
136
+ })().catch(reason => setError(describeAccountFlowError(reason, t))).finally(() => setPending(false));
137
+ };
138
+ const cancel = cancelled => {
139
+ void oxyServices.cancelIdentityLink(cancelled.linkId).catch(() => undefined);
140
+ setStep({
141
+ name: 'expired'
142
+ });
143
+ };
144
+ if (alreadyLinked) {
145
+ return /*#__PURE__*/_jsx(OxyAuthScreen, {
146
+ children: /*#__PURE__*/_jsx(OxyAuthScreenHeader, {
147
+ title: t('linkCommons.title'),
148
+ description: t('linkCommons.already')
149
+ })
150
+ });
151
+ }
152
+ switch (step.name) {
153
+ case 'done':
154
+ return /*#__PURE__*/_jsx(OxyAuthScreen, {
155
+ children: /*#__PURE__*/_jsx(OxyAuthScreenHeader, {
156
+ title: t('linkCommons.doneTitle'),
157
+ description: t('linkCommons.done')
158
+ })
159
+ });
160
+ case 'expired':
161
+ return /*#__PURE__*/_jsxs(OxyAuthScreen, {
162
+ children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
163
+ title: t('linkCommons.title'),
164
+ description: t('linkCommons.expired')
165
+ }), error ? /*#__PURE__*/_jsx(AccountFlowErrorLine, {
166
+ message: error
167
+ }) : null, /*#__PURE__*/_jsx(AccountFlowAction, {
168
+ label: t('linkCommons.renew'),
169
+ onPress: open,
170
+ pending: false,
171
+ testID: "link-commons-renew"
172
+ })]
173
+ });
174
+ case 'matching':
175
+ return /*#__PURE__*/_jsxs(OxyAuthScreen, {
176
+ children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
177
+ title: t('linkCommons.compareTitle'),
178
+ description: t('linkCommons.compare')
179
+ }), /*#__PURE__*/_jsx(Text, {
180
+ accessibilityLabel: step.code.split('').join(' '),
181
+ style: [styles.code, {
182
+ color: theme.colors.text
183
+ }],
184
+ testID: "link-commons-code",
185
+ children: `${step.code.slice(0, 3)} ${step.code.slice(3)}`
186
+ }), error ? /*#__PURE__*/_jsx(AccountFlowErrorLine, {
187
+ message: error
188
+ }) : null, /*#__PURE__*/_jsx(AccountFlowAction, {
189
+ label: t('linkCommons.confirm'),
190
+ onPress: () => confirm(step.link),
191
+ pending: pending,
192
+ testID: "link-commons-confirm"
193
+ }), /*#__PURE__*/_jsx(Button, {
194
+ appearance: "plain",
195
+ tone: "neutral",
196
+ size: "lg",
197
+ fullWidth: true,
198
+ disabled: pending,
199
+ onPress: () => cancel(step.link),
200
+ testID: "link-commons-cancel",
201
+ children: t('linkCommons.cancel')
202
+ })]
203
+ });
204
+ case 'qr':
205
+ return /*#__PURE__*/_jsxs(OxyAuthScreen, {
206
+ children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
207
+ title: t('linkCommons.title'),
208
+ description: t('linkCommons.subtitle')
209
+ }), /*#__PURE__*/_jsx(View, {
210
+ style: styles.plateRow,
211
+ children: /*#__PURE__*/_jsx(View, {
212
+ style: [styles.plate, {
213
+ borderColor: theme.colors.border
214
+ }],
215
+ testID: "link-commons-qr",
216
+ children: /*#__PURE__*/_jsx(QRCode, {
217
+ value: step.link.qrPayload,
218
+ size: QR_SIZE,
219
+ backgroundColor: QR_PLATE_BG,
220
+ color: QR_FOREGROUND
221
+ })
222
+ })
223
+ }), /*#__PURE__*/_jsx(AccountFlowNote, {
224
+ children: t('linkCommons.scan')
225
+ }), /*#__PURE__*/_jsx(AccountFlowNote, {
226
+ children: t('linkCommons.waiting')
227
+ }), /*#__PURE__*/_jsx(Button, {
228
+ appearance: "plain",
229
+ tone: "neutral",
230
+ size: "lg",
231
+ fullWidth: true,
232
+ onPress: () => cancel(step.link),
233
+ testID: "link-commons-cancel",
234
+ children: t('linkCommons.cancel')
235
+ })]
236
+ });
237
+ default:
238
+ return /*#__PURE__*/_jsxs(OxyAuthScreen, {
239
+ children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
240
+ title: t('linkCommons.title'),
241
+ description: t('linkCommons.subtitle')
242
+ }), /*#__PURE__*/_jsx(View, {
243
+ style: styles.plateRow,
244
+ children: /*#__PURE__*/_jsx(ActivityIndicator, {
245
+ size: "large",
246
+ color: theme.colors.primary
247
+ })
248
+ })]
249
+ });
250
+ }
251
+ };
252
+ const styles = StyleSheet.create({
253
+ plateRow: {
254
+ alignItems: 'center'
255
+ },
256
+ plate: {
257
+ padding: 12,
258
+ borderRadius: 16,
259
+ borderWidth: StyleSheet.hairlineWidth,
260
+ backgroundColor: QR_PLATE_BG
261
+ },
262
+ code: {
263
+ fontSize: 40,
264
+ lineHeight: 48,
265
+ fontWeight: '700',
266
+ letterSpacing: 4,
267
+ textAlign: 'center'
268
+ }
269
+ });
270
+ //# sourceMappingURL=OxyLinkCommonsPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useEffect","useRef","useState","ActivityIndicator","StyleSheet","View","QRCode","Button","useTheme","Text","deriveIdentityLinkCode","useOxy","PASSKEY_UNSUPPORTED_MESSAGE","useI18n","isPasskeySupported","runAuthenticationCeremony","OxyAuthScreen","OxyAuthScreenHeader","AccountFlowAction","AccountFlowErrorLine","AccountFlowNote","describeAccountFlowError","jsx","_jsx","jsxs","_jsxs","IDENTITY_LINK_POLL_MS","QR_PLATE_BG","QR_FOREGROUND","QR_SIZE","OxyLinkCommonsPanel","onLinked","theme","t","user","oxyServices","step","setStep","name","pending","setPending","error","setError","alreadyLinked","Boolean","publicKey","open","createIdentityLink","then","link","catch","reason","opened","current","stopped","poll","Date","now","expiresAt","state","getIdentityLink","linkId","status","code","timer","setTimeout","clearTimeout","confirm","confirmed","Error","options","getIdentityLinkAssertionOptions","challenge","assertion","completeIdentityLink","finally","cancel","cancelled","cancelIdentityLink","undefined","children","title","description","message","label","onPress","testID","accessibilityLabel","split","join","style","styles","color","colors","text","slice","appearance","tone","size","fullWidth","disabled","plateRow","plate","borderColor","border","value","qrPayload","backgroundColor","primary","create","alignItems","padding","borderRadius","borderWidth","hairlineWidth","fontSize","lineHeight","fontWeight","letterSpacing","textAlign"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/OxyLink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dC,UAAU,EAAE,KAAK;IACjBC,aAAa,EAAE,CAAC;IAChBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Recovering a passkey account (ADR 0029 D3), auth.oxy.so's `/recover`:
5
+ *
6
+ * username or email → the code sent to the recovery email → new passkey → signed in
7
+ *
8
+ * The first step answers the same whether or not the account exists, so it
9
+ * never says who has one. An account that uses Commons has no recovery email:
10
+ * it recovers in Commons with its phrase, and the first step says so. The new
11
+ * passkey joins the ones the account has; lost ones are removed afterwards in
12
+ * the account's security settings.
13
+ */
14
+
15
+ import { useState } from 'react';
16
+ import { useTheme } from '@oxy.so/bloom/theme';
17
+ import { DeviceManager } from '@oxy.so/core';
18
+ import { useOxy } from "../../context/OxyContext.js";
19
+ import { runPasskeyRegisterSignIn } from "../../context/passkeyFlow.js";
20
+ import { useI18n } from "../../hooks/useI18n.js";
21
+ import { isPasskeySupported, runRegistrationCeremony } from '../../../webauthn/passkeyClient';
22
+ import { SubtleLink } from "../authChooser/primitives.js";
23
+ import { OxyAuthScreen, OxyAuthScreenHeader, OxyAuthTerms } from "./OxyAuthScreen.js";
24
+ import { AccountFlowAction, AccountFlowErrorLine, AccountFlowField, AccountFlowNote, EmailCodeStep, describeAccountFlowError, isTicketExpired } from "./accountFlowParts.js";
25
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
+ export const OxyRecoverAccountPanel = ({
27
+ onRecovered,
28
+ onSignIn
29
+ }) => {
30
+ const theme = useTheme();
31
+ const {
32
+ t
33
+ } = useI18n();
34
+ const {
35
+ oxyServices,
36
+ handleWebSession
37
+ } = useOxy();
38
+ const [step, setStep] = useState({
39
+ name: 'entry'
40
+ });
41
+ const [identifier, setIdentifier] = useState('');
42
+ const [pending, setPending] = useState(false);
43
+ const [error, setError] = useState(null);
44
+ const run = work => {
45
+ if (pending) return;
46
+ setError(null);
47
+ setPending(true);
48
+ work().catch(reason => {
49
+ if (isTicketExpired(reason)) setStep({
50
+ name: 'entry'
51
+ });
52
+ setError(describeAccountFlowError(reason, t));
53
+ }).finally(() => setPending(false));
54
+ };
55
+ const sendCode = async () => {
56
+ const {
57
+ verificationId
58
+ } = await oxyServices.startEmailVerification({
59
+ purpose: 'recovery',
60
+ identifier: identifier.trim()
61
+ });
62
+ setStep({
63
+ name: 'code',
64
+ verificationId
65
+ });
66
+ };
67
+ const submitIdentifier = () => {
68
+ if (!identifier.trim()) {
69
+ setError(t('recover.identifier.required'));
70
+ return;
71
+ }
72
+ run(sendCode);
73
+ };
74
+
75
+ // The ceremony opens the browser's passkey prompt, so it starts from the press.
76
+ const addPasskey = recoveryTicket => run(() => runPasskeyRegisterSignIn({
77
+ isSupported: isPasskeySupported,
78
+ getRegisterOptions: () => oxyServices.webauthnRegisterOptions({
79
+ recoveryTicket
80
+ }),
81
+ runCeremony: runRegistrationCeremony,
82
+ registerVerify: response => oxyServices.webauthnRegisterVerify(response, {
83
+ recoveryTicket,
84
+ deviceFingerprint: JSON.stringify(DeviceManager.getDeviceFingerprint())
85
+ }),
86
+ commit: async session => {
87
+ await handleWebSession(session);
88
+ onRecovered();
89
+ }
90
+ }));
91
+ switch (step.name) {
92
+ case 'code':
93
+ return /*#__PURE__*/_jsx(EmailCodeStep, {
94
+ description: t('emailCode.sentIfAccount'),
95
+ verificationId: step.verificationId,
96
+ onConfirmed: ({
97
+ ticket,
98
+ username
99
+ }) => {
100
+ setError(null);
101
+ setStep({
102
+ name: 'passkey',
103
+ recoveryTicket: ticket,
104
+ username
105
+ });
106
+ },
107
+ onResend: sendCode,
108
+ back: {
109
+ label: t('signin.actions.back'),
110
+ onPress: () => setStep({
111
+ name: 'entry'
112
+ })
113
+ }
114
+ });
115
+ case 'passkey':
116
+ return /*#__PURE__*/_jsxs(OxyAuthScreen, {
117
+ children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
118
+ title: t('recover.passkey.title'),
119
+ description: t('recover.passkey.subtitle', {
120
+ username: step.username ?? ''
121
+ })
122
+ }), error ? /*#__PURE__*/_jsx(AccountFlowErrorLine, {
123
+ message: error
124
+ }) : null, /*#__PURE__*/_jsx(AccountFlowAction, {
125
+ label: t('recover.passkey.action'),
126
+ onPress: () => addPasskey(step.recoveryTicket),
127
+ pending: pending,
128
+ testID: "recover-create-passkey"
129
+ }), /*#__PURE__*/_jsx(OxyAuthTerms, {})]
130
+ });
131
+ default:
132
+ return /*#__PURE__*/_jsxs(OxyAuthScreen, {
133
+ children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
134
+ title: t('recover.title'),
135
+ description: t('recover.subtitle')
136
+ }), /*#__PURE__*/_jsx(AccountFlowField, {
137
+ label: t('recover.identifier.label'),
138
+ value: identifier,
139
+ onChange: value => {
140
+ setIdentifier(value);
141
+ if (error) setError(null);
142
+ },
143
+ onSubmit: submitIdentifier,
144
+ error: error,
145
+ disabled: pending,
146
+ placeholder: t('recover.identifier.placeholder'),
147
+ autoComplete: "username",
148
+ testID: "recover-identifier"
149
+ }), /*#__PURE__*/_jsx(AccountFlowNote, {
150
+ children: t('recover.commonsNote')
151
+ }), /*#__PURE__*/_jsx(AccountFlowAction, {
152
+ label: t('signin.actions.continue'),
153
+ onPress: submitIdentifier,
154
+ pending: pending,
155
+ testID: "recover-continue"
156
+ }), /*#__PURE__*/_jsx(SubtleLink, {
157
+ label: t('recover.backToSignIn'),
158
+ theme: theme,
159
+ onPress: onSignIn,
160
+ testID: "back-to-sign-in"
161
+ }), /*#__PURE__*/_jsx(OxyAuthTerms, {})]
162
+ });
163
+ }
164
+ };
165
+ //# sourceMappingURL=OxyRecoverAccountPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useState","useTheme","DeviceManager","useOxy","runPasskeyRegisterSignIn","useI18n","isPasskeySupported","runRegistrationCeremony","SubtleLink","OxyAuthScreen","OxyAuthScreenHeader","OxyAuthTerms","AccountFlowAction","AccountFlowErrorLine","AccountFlowField","AccountFlowNote","EmailCodeStep","describeAccountFlowError","isTicketExpired","jsx","_jsx","jsxs","_jsxs","OxyRecoverAccountPanel","onRecovered","onSignIn","theme","t","oxyServices","handleWebSession","step","setStep","name","identifier","setIdentifier","pending","setPending","error","setError","run","work","catch","reason","finally","sendCode","verificationId","startEmailVerification","purpose","trim","submitIdentifier","addPasskey","recoveryTicket","isSupported","getRegisterOptions","webauthnRegisterOptions","runCeremony","registerVerify","response","webauthnRegisterVerify","deviceFingerprint","JSON","stringify","getDeviceFingerprint","commit","session","description","onConfirmed","ticket","username","onResend","back","label","onPress","children","title","message","testID","value","onChange","onSubmit","disabled","placeholder","autoComplete"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/OxyRecoverAccountPanel.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,MAAM,QAAQ,6BAA0B;AACjD,SAASC,wBAAwB,QAAQ,8BAA2B;AACpE,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,kBAAkB,EAAEC,uBAAuB,QAAQ,iCAAiC;AAC7F,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,YAAY,QAAQ,oBAAiB;AAClF,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,EACbC,wBAAwB,EACxBC,eAAe,QACV,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAc5B,OAAO,MAAMC,sBAA6D,GAAGA,CAAC;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAK;EAC1G,MAAMC,KAAK,GAAGzB,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAE0B;EAAE,CAAC,GAAGtB,OAAO,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