@oxy.so/services 12.3.0 → 12.4.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.
- package/README.md +1 -1
- package/lib/commonjs/index.js +17 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyAuthenticatorPanel.js +11 -10
- package/lib/commonjs/ui/components/signIn/OxyAuthenticatorPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js +19 -18
- package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyEmailPanel.js +251 -0
- package/lib/commonjs/ui/components/signIn/OxyEmailPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +40 -33
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js +51 -19
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxySignInSecurityPanel.js +154 -0
- package/lib/commonjs/ui/components/signIn/OxySignInSecurityPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/ReauthStep.js +6 -4
- package/lib/commonjs/ui/components/signIn/ReauthStep.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/SessionsSection.js +200 -0
- package/lib/commonjs/ui/components/signIn/SessionsSection.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js +6 -0
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/accountSecurityState.js +74 -0
- package/lib/commonjs/ui/components/signIn/accountSecurityState.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +1 -1
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/screenComponents.js +4 -0
- package/lib/commonjs/ui/navigation/screenComponents.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSecurityPanelScreen.js +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +8 -196
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInEmailScreen.js +19 -0
- package/lib/commonjs/ui/screens/SignInEmailScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInSecurityScreen.js +30 -0
- package/lib/commonjs/ui/screens/SignInSecurityScreen.js.map +1 -0
- package/lib/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyAuthenticatorPanel.js +12 -11
- package/lib/module/ui/components/signIn/OxyAuthenticatorPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js +20 -19
- package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyEmailPanel.js +246 -0
- package/lib/module/ui/components/signIn/OxyEmailPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +40 -33
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js +52 -20
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxySignInSecurityPanel.js +149 -0
- package/lib/module/ui/components/signIn/OxySignInSecurityPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/ReauthStep.js +6 -4
- package/lib/module/ui/components/signIn/ReauthStep.js.map +1 -1
- package/lib/module/ui/components/signIn/SessionsSection.js +194 -0
- package/lib/module/ui/components/signIn/SessionsSection.js.map +1 -0
- package/lib/module/ui/components/signIn/accountFlowParts.js +6 -0
- package/lib/module/ui/components/signIn/accountFlowParts.js.map +1 -1
- package/lib/module/ui/components/signIn/accountSecurityState.js +69 -0
- package/lib/module/ui/components/signIn/accountSecurityState.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +1 -1
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/screenComponents.js +4 -0
- package/lib/module/ui/navigation/screenComponents.js.map +1 -1
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/screens/AccountSecurityPanelScreen.js +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +9 -197
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInEmailScreen.js +17 -0
- package/lib/module/ui/screens/SignInEmailScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInSecurityScreen.js +26 -0
- package/lib/module/ui/screens/SignInSecurityScreen.js.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthenticatorPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyEmailPanel.d.ts +21 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyEmailPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyPasswordPanel.d.ts +5 -4
- package/lib/typescript/commonjs/ui/components/signIn/OxyPasswordPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInSecurityPanel.d.ts +25 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInSecurityPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts +8 -2
- package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/SessionsSection.d.ts +9 -0
- package/lib/typescript/commonjs/ui/components/signIn/SessionsSection.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/accountSecurityState.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/signIn/accountSecurityState.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/screenComponents.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +2 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSecurityPanelScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +3 -2
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SignInEmailScreen.d.ts +6 -0
- package/lib/typescript/commonjs/ui/screens/SignInEmailScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/SignInSecurityScreen.d.ts +6 -0
- package/lib/typescript/commonjs/ui/screens/SignInSecurityScreen.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +4 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyAuthenticatorPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts +3 -2
- package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyEmailPanel.d.ts +21 -0
- package/lib/typescript/module/ui/components/signIn/OxyEmailPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts +2 -1
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyPasswordPanel.d.ts +5 -4
- package/lib/typescript/module/ui/components/signIn/OxyPasswordPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxySignInSecurityPanel.d.ts +25 -0
- package/lib/typescript/module/ui/components/signIn/OxySignInSecurityPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts +8 -2
- package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/SessionsSection.d.ts +9 -0
- package/lib/typescript/module/ui/components/signIn/SessionsSection.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/accountSecurityState.d.ts +26 -0
- package/lib/typescript/module/ui/components/signIn/accountSecurityState.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/screenComponents.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +2 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSecurityPanelScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +3 -2
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SignInEmailScreen.d.ts +6 -0
- package/lib/typescript/module/ui/screens/SignInEmailScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/SignInSecurityScreen.d.ts +6 -0
- package/lib/typescript/module/ui/screens/SignInSecurityScreen.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/index.ts +7 -2
- package/src/ui/components/signIn/OxyAuthenticatorPanel.tsx +11 -8
- package/src/ui/components/signIn/OxyDeleteAccountPanel.tsx +15 -16
- package/src/ui/components/signIn/OxyEmailPanel.tsx +258 -0
- package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +27 -15
- package/src/ui/components/signIn/OxyPasswordPanel.tsx +49 -14
- package/src/ui/components/signIn/OxySignInSecurityPanel.tsx +147 -0
- package/src/ui/components/signIn/ReauthStep.tsx +13 -4
- package/src/ui/components/signIn/SessionsSection.tsx +218 -0
- package/src/ui/components/signIn/accountFlowParts.tsx +6 -0
- package/src/ui/components/signIn/accountSecurityState.tsx +75 -0
- package/src/ui/navigation/routes.ts +5 -1
- package/src/ui/navigation/screenComponents.ts +4 -0
- package/src/ui/navigation/surfaceRegistry.ts +2 -0
- package/src/ui/screens/AccountSecurityPanelScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +8 -241
- package/src/ui/screens/SignInEmailScreen.tsx +13 -0
- package/src/ui/screens/SignInSecurityScreen.tsx +19 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Sign-in & security": every way the signed-in account signs in, each with
|
|
3
|
+
* its state, and every place it is signed in. One page, rendered by the
|
|
4
|
+
* account dialog's "Manage your account" (`SignInSecurity`) and by the
|
|
5
|
+
* Accounts app's security page.
|
|
6
|
+
*
|
|
7
|
+
* Each method opens its own panel: the email (`SignInEmail`), the password
|
|
8
|
+
* (`SignInPassword`), the authenticator app (`SignInAuthenticator`) and
|
|
9
|
+
* linking Commons (`LinkCommons`). An account with a Commons key signs in with
|
|
10
|
+
* Commons, so it sees only that; an organization, project or bot has no
|
|
11
|
+
* methods of its own, only its sessions.
|
|
12
|
+
*/
|
|
13
|
+
import type React from 'react';
|
|
14
|
+
import type { RouteName } from '../../navigation/routes.js';
|
|
15
|
+
type SignInSecurityRoute = Extract<RouteName, 'SignInEmail' | 'SignInPassword' | 'SignInAuthenticator' | 'LinkCommons'>;
|
|
16
|
+
export interface OxySignInSecurityPanelProps {
|
|
17
|
+
/**
|
|
18
|
+
* Open one method's panel. Defaults to the provider's `showBottomSheet`;
|
|
19
|
+
* a surface passes its own `navigate` so the panel stacks inside it.
|
|
20
|
+
*/
|
|
21
|
+
onOpen?: (route: SignInSecurityRoute) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const OxySignInSecurityPanel: React.FC<OxySignInSecurityPanelProps>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=OxySignInSecurityPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxySignInSecurityPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignInSecurityPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAAyB,CAAC;AAMzD,KAAK,mBAAmB,GAAG,OAAO,CAChC,SAAS,EACT,aAAa,GAAG,gBAAgB,GAAG,qBAAqB,GAAG,aAAa,CACzE,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC/C;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA4GxE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* "Confirm it's you": the fresh proof a sensitive change carries (`reauth`) —
|
|
3
3
|
* a code sent to the account's email for THIS change, or the current password
|
|
4
|
-
* where the change accepts one
|
|
5
|
-
*
|
|
4
|
+
* where the change accepts one (the only proof of an account without an
|
|
5
|
+
* email) — plus the authenticator's code (or a backup code) when the account
|
|
6
|
+
* has one. The screen that needs it puts its own fields
|
|
6
7
|
* above (`children`) and names its own action; this owns the proof.
|
|
7
8
|
*/
|
|
8
9
|
import type React from 'react';
|
|
@@ -14,6 +15,11 @@ export interface ReauthStepProps {
|
|
|
14
15
|
action: ReauthAction;
|
|
15
16
|
/** The account has a password, and this change accepts it. */
|
|
16
17
|
allowPassword?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The account has an email, and this change accepts a code sent to it.
|
|
20
|
+
* Without it the proof is the password alone.
|
|
21
|
+
*/
|
|
22
|
+
allowEmail?: boolean;
|
|
17
23
|
/** The account has an authenticator: its code is required too. */
|
|
18
24
|
totpEnabled: boolean;
|
|
19
25
|
/** The screen's action, once the proof is ready. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReauthStep.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/ReauthStep.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ReauthStep.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/ReauthStep.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiBnE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,MAAM,EAAE,YAAY,CAAC;IACrB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,WAAW,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,iCAAiC;IACjC,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6LhD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Where you're signed in": the signed-in account's sessions on every device,
|
|
3
|
+
* from the server (`oxy.devices.sessions`). Removing one ends that session;
|
|
4
|
+
* "Sign out of all other devices" ends every session but this one
|
|
5
|
+
* (`oxy.devices.logoutAll`) — it never signs this device out.
|
|
6
|
+
*/
|
|
7
|
+
import type React from 'react';
|
|
8
|
+
export declare const SessionsSection: React.FC;
|
|
9
|
+
//# sourceMappingURL=SessionsSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionsSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/SessionsSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4C/B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAsKnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountFlowParts.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/accountFlowParts.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAW1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AAItD,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG5D;AAUD,0CAA0C;AAC1C,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIxD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"accountFlowParts.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/accountFlowParts.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAW1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AAItD,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG5D;AAUD,0CAA0C;AAC1C,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIxD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAyCxE;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMvD;AAOD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI3D;AAED,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;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AE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,sDAAsD;IACtD,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAC7C,oFAAoF;IACpF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,qGAAqG;AACrG,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8EtD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every security panel of the signed-in account reads first: whether it
|
|
3
|
+
* holds a Commons key (it signs in with Commons, nothing here applies),
|
|
4
|
+
* whether it is a personal account (only those sign in with an email, a
|
|
5
|
+
* password or an authenticator — the API refuses the rest), and how it signs
|
|
6
|
+
* in. A panel that cannot show its methods says why instead of spinning.
|
|
7
|
+
*/
|
|
8
|
+
import type React from 'react';
|
|
9
|
+
import type { SignInMethods } from '@oxy.so/contracts';
|
|
10
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
11
|
+
import type { Translate } from '../authChooser/types.js';
|
|
12
|
+
export interface AccountSecurityState {
|
|
13
|
+
/** The account holds a Commons key. */
|
|
14
|
+
keyed: boolean;
|
|
15
|
+
/** A personal account (an organization, project or bot signs in through its people). */
|
|
16
|
+
personal: boolean;
|
|
17
|
+
methods: UseQueryResult<SignInMethods>;
|
|
18
|
+
}
|
|
19
|
+
export declare function useAccountSecurityState(): AccountSecurityState;
|
|
20
|
+
/**
|
|
21
|
+
* The screen a panel shows while its methods are not there to act on: not a
|
|
22
|
+
* personal account, the read failed (with a retry), or still loading. `null`
|
|
23
|
+
* once `methods.data` is ready.
|
|
24
|
+
*/
|
|
25
|
+
export declare function accountSecurityFallback(state: AccountSecurityState, title: string, t: Translate): React.ReactElement | null;
|
|
26
|
+
//# sourceMappingURL=accountSecurityState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountSecurityState.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/accountSecurityState.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AAItD,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,wFAAwF;IACxF,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;CACxC;AAED,wBAAgB,uBAAuB,IAAI,oBAAoB,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,MAAM,EACb,CAAC,EAAE,SAAS,GACX,KAAK,CAAC,YAAY,GAAG,IAAI,CA+B3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { BaseScreenProps } from '../types/navigation.js';
|
|
3
|
-
export type RouteName = 'Supervision' | 'ManageAccount' | 'AccountVerification' | 'PaymentGateway' | 'Profile' | 'LanguageSelector' | 'PrivacySettings' | 'SearchSettings' | 'FileManagement' | 'FileTrash' | 'HelpSupport' | 'ReportBug' | 'OxyOne' | 'LegalDocuments' | 'AppInfo' | 'WelcomeNewUser' | 'HistoryView' | 'EditProfile' | 'EditProfileField' | 'LearnMoreUsernames' | 'TrustCenter' | 'TrustLeaderboard' | 'TrustRewards' | 'TrustRules' | 'AboutTrust' | 'TrustFAQ' | 'FollowersList' | 'FollowingList' | 'CreateAccount' | 'AccountMembers' | 'AccountSettings' | 'ChangeAvatar' | 'AvatarCrop' | 'Notifications' | 'ConnectedApps' | 'Domains' | 'Preferences' | 'DeleteAccount' | 'LinkCommons' | 'SignInPassword' | 'SignInAuthenticator' | 'AccountDialog';
|
|
3
|
+
export type RouteName = 'Supervision' | 'ManageAccount' | 'AccountVerification' | 'PaymentGateway' | 'Profile' | 'LanguageSelector' | 'PrivacySettings' | 'SearchSettings' | 'FileManagement' | 'FileTrash' | 'HelpSupport' | 'ReportBug' | 'OxyOne' | 'LegalDocuments' | 'AppInfo' | 'WelcomeNewUser' | 'HistoryView' | 'EditProfile' | 'EditProfileField' | 'LearnMoreUsernames' | 'TrustCenter' | 'TrustLeaderboard' | 'TrustRewards' | 'TrustRules' | 'AboutTrust' | 'TrustFAQ' | 'FollowersList' | 'FollowingList' | 'CreateAccount' | 'AccountMembers' | 'AccountSettings' | 'ChangeAvatar' | 'AvatarCrop' | 'Notifications' | 'ConnectedApps' | 'Domains' | 'Preferences' | 'DeleteAccount' | 'LinkCommons' | 'SignInSecurity' | 'SignInEmail' | 'SignInPassword' | 'SignInAuthenticator' | 'AccountDialog';
|
|
4
4
|
type ScreenComponents = Record<RouteName, ComponentType<never>>;
|
|
5
5
|
export declare function registerScreens(screens: ScreenComponents): void;
|
|
6
6
|
export declare function screensReady(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAE3D,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,WAAW,GACX,QAAQ,GACR,gBAAgB,GAChB,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,eAAe,GACf,eAAe,GACf,SAAS,GACT,aAAa,GACb,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,qBAAqB,GACrB,eAAe,CAAC;AAEpB,KAAK,gBAAgB,GAAG,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAIhE,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAE/D;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,oFAAoF;AACpF,wBAAgB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAW3C;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,SAAS,KAAG,aAAa,CAAC,eAAe,CAAC,GAAG,SACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAE3D,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,WAAW,GACX,QAAQ,GACR,gBAAgB,GAChB,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,eAAe,GACf,eAAe,GACf,SAAS,GACT,aAAa,GACb,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,aAAa,GACb,gBAAgB,GAChB,qBAAqB,GACrB,eAAe,CAAC;AAEpB,KAAK,gBAAgB,GAAG,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAIhE,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAE/D;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,oFAAoF;AACpF,wBAAgB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAW3C;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,SAAS,KAAG,aAAa,CAAC,eAAe,CAAC,GAAG,SACpB,CAAC;AAgDpE,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,IAAI,IAAI,SAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenComponents.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/screenComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"screenComponents.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/screenComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;AA8C1C,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,CAoDpE,CAAC"}
|
|
@@ -81,6 +81,8 @@ export interface SurfaceRegistry {
|
|
|
81
81
|
Preferences: SurfaceRoute;
|
|
82
82
|
DeleteAccount: SurfaceRoute;
|
|
83
83
|
LinkCommons: SurfaceRoute;
|
|
84
|
+
SignInSecurity: SurfaceRoute;
|
|
85
|
+
SignInEmail: SurfaceRoute;
|
|
84
86
|
SignInPassword: SurfaceRoute;
|
|
85
87
|
SignInAuthenticator: SurfaceRoute;
|
|
86
88
|
/** Unified account switcher + sign-in surface (folded `OxyAccountDialogScreen` body). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaceRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/surfaceRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAA+B,CAAC;AAEzE;;;;;;;;;;GAUG;AAEH,sFAAsF;AACtF,KAAK,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,IAAI;IAClE,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,YAAY,CAAC;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5E,aAAa,EAAE,YAAY,CAAC;IAC5B,mBAAmB,EAAE,YAAY,CAAC;IAClC,cAAc,EAAE,YAAY,CAAC;I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OAkBG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,iFAAiF;IACjF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mFAAmF;IACnF,eAAe,EAAE,OAAO,CAAC;IACzB,qFAAqF;IACrF,eAAe,CAAC,EAAE,MAAM,SAAS,CAAC;CACnC;AAsDD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,SAAS,EAChB,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,kBAsBF,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,EAChB,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,mBAAkE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The frame the account's own security panels render in when presented as a
|
|
3
|
-
* surface (`showBottomSheet('DeleteAccount' | 'LinkCommons' | 'SignInPassword'
|
|
3
|
+
* surface (`showBottomSheet('DeleteAccount' | 'LinkCommons' | 'SignInEmail' | 'SignInPassword'
|
|
4
4
|
* | 'SignInAuthenticator')`): the panel draws its own large header, so the bar
|
|
5
5
|
* holds only the way back, and the body keeps the dialog's screen gutter.
|
|
6
6
|
*/
|
|
@@ -4,8 +4,9 @@ import type { BaseScreenProps } from '../types/navigation.js';
|
|
|
4
4
|
* Unified "Manage your Oxy Account" screen.
|
|
5
5
|
*
|
|
6
6
|
* Replaces AccountOverview + AccountSettings + the per-account half of
|
|
7
|
-
* SessionManagement. Lists ONLY the active user's profile,
|
|
8
|
-
*
|
|
7
|
+
* SessionManagement. Lists ONLY the active user's profile, its sign-in and
|
|
8
|
+
* security page (`SignInSecurity`: methods and sessions), and the destructive
|
|
9
|
+
* actions for THIS account. Multi-account
|
|
9
10
|
* surface lives in the unified `OxyAccountDialogScreen` — keep these concerns separate.
|
|
10
11
|
*/
|
|
11
12
|
interface ManageAccountScreenProps extends BaseScreenProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ManageAccountScreen.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ManageAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ManageAccountScreen.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAY3D;;;;;;;;GAQG;AACH,UAAU,wBAAyB,SAAQ,eAAe;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAyd3D,CAAC;AAYF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { BaseScreenProps } from '../types/navigation.js';
|
|
3
|
+
/** `SignInEmail`: add, change or remove the account's email. */
|
|
4
|
+
declare const SignInEmailScreen: React.FC<BaseScreenProps>;
|
|
5
|
+
export default SignInEmailScreen;
|
|
6
|
+
//# sourceMappingURL=SignInEmailScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignInEmailScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/SignInEmailScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAG3D,gEAAgE;AAChE,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIhD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { BaseScreenProps } from '../types/navigation.js';
|
|
3
|
+
/** `SignInSecurity`: how the account signs in, and where it is signed in. */
|
|
4
|
+
declare const SignInSecurityScreen: React.FC<BaseScreenProps>;
|
|
5
|
+
export default SignInSecurityScreen;
|
|
6
|
+
//# sourceMappingURL=SignInSecurityScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignInSecurityScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/SignInSecurityScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAE3D,6EAA6E;AAC7E,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAQnD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.0",
|
|
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",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"prepublishOnly": "node ../../scripts/assert-bun-publish.mjs && bun run typescript && bun run test && bun run build"
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
|
-
"@oxy.so/contracts": "^5.
|
|
154
|
+
"@oxy.so/contracts": "^5.1.0",
|
|
155
155
|
"color": "^5.0.3",
|
|
156
156
|
"@peable.to/sdk": "0.4.1"
|
|
157
157
|
},
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@commitlint/config-conventional": "^21.2.0",
|
|
161
161
|
"@expo/app-integrity": "~58.0.2",
|
|
162
162
|
"@expo/vector-icons": "^15.0.3",
|
|
163
|
-
"@oxy.so/core": "6.
|
|
163
|
+
"@oxy.so/core": "6.1.0",
|
|
164
164
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
165
165
|
"@react-native-community/netinfo": "^12.0.1",
|
|
166
166
|
"@react-native/babel-preset": "^0.88.0",
|
|
@@ -210,12 +210,12 @@
|
|
|
210
210
|
"expo-video": "~58.0.11"
|
|
211
211
|
},
|
|
212
212
|
"//@oxy.so/bloom": "Bloom 11.1.0 adds the shared grouped sections, usage card, subscription plans, frame appearance and overlay navigation APIs used by this SDK. First-party Bloom peers remain open above this tested minimum.",
|
|
213
|
-
"//@oxy.so/core": "Core
|
|
213
|
+
"//@oxy.so/core": "Core 6.1.0 supplies `oxy.auth.email.{startChange,change,remove}` and `oxy.auth.password.remove`, which the sign-in & security panels call, and their translations. Keep one Core instance per app; raise this floor with the root catalogue when new runtime APIs are required.",
|
|
214
214
|
"peerDependencies": {
|
|
215
215
|
"@expo/app-integrity": ">=56.0.0 <59.0.0",
|
|
216
216
|
"@expo/vector-icons": "^15.0.3",
|
|
217
217
|
"@oxy.so/bloom": ">=11.1.0",
|
|
218
|
-
"@oxy.so/core": "^
|
|
218
|
+
"@oxy.so/core": "^6.1.0",
|
|
219
219
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
220
220
|
"@react-native-community/netinfo": ">=11.4.1 <13.0.0",
|
|
221
221
|
"@tanstack/query-async-storage-persister": "^5.101",
|
package/src/index.ts
CHANGED
|
@@ -394,8 +394,13 @@ export type { OxySignUpPanelProps } from './ui/components/signIn/OxySignUpPanel'
|
|
|
394
394
|
export { OxyAccountPicker } from './ui/components/signIn/OxyAccountPicker';
|
|
395
395
|
export type { OxyAccountPickerProps } from './ui/components/signIn/OxyAccountPicker';
|
|
396
396
|
// The account's own sign-in security, for its settings (the Accounts app, and
|
|
397
|
-
// the account dialog's "Manage your account" through the `
|
|
398
|
-
// `
|
|
397
|
+
// the account dialog's "Manage your account" through the `SignInSecurity`,
|
|
398
|
+
// `SignInEmail`, `SignInPassword`, `SignInAuthenticator`, `LinkCommons` and
|
|
399
|
+
// `DeleteAccount` routes).
|
|
400
|
+
export { OxySignInSecurityPanel } from './ui/components/signIn/OxySignInSecurityPanel';
|
|
401
|
+
export type { OxySignInSecurityPanelProps } from './ui/components/signIn/OxySignInSecurityPanel';
|
|
402
|
+
export { OxyEmailPanel } from './ui/components/signIn/OxyEmailPanel';
|
|
403
|
+
export type { OxyEmailPanelProps } from './ui/components/signIn/OxyEmailPanel';
|
|
399
404
|
export { OxyDeleteAccountPanel } from './ui/components/signIn/OxyDeleteAccountPanel';
|
|
400
405
|
export type { OxyDeleteAccountPanelProps } from './ui/components/signIn/OxyDeleteAccountPanel';
|
|
401
406
|
export { OxyLinkCommonsPanel } from './ui/components/signIn/OxyLinkCommonsPanel';
|
|
@@ -23,12 +23,11 @@ import type { TotpEnrollResponse } from '@oxy.so/contracts';
|
|
|
23
23
|
import { TOTP_DIGITS } from '@oxy.so/contracts/client';
|
|
24
24
|
import { useQueryClient } from '@tanstack/react-query';
|
|
25
25
|
import { useOxy } from '../../context/oxyRuntimeContext';
|
|
26
|
-
import { useSignInMethods } from '../../hooks/queries/useAuthMethods';
|
|
27
26
|
import { queryKeys } from '../../hooks/queries/queryKeys';
|
|
28
27
|
import { useI18n } from '../../hooks/useI18n';
|
|
29
28
|
import { copyText } from '../../utils/clipboard';
|
|
30
29
|
import { SubtleLink } from '../authChooser/primitives';
|
|
31
|
-
import {
|
|
30
|
+
import { OxyAuthScreen, OxyAuthScreenHeader } from './OxyAuthScreen';
|
|
32
31
|
import { ReauthStep } from './ReauthStep';
|
|
33
32
|
import {
|
|
34
33
|
AccountFlowAction,
|
|
@@ -38,6 +37,7 @@ import {
|
|
|
38
37
|
AccountFlowProgress,
|
|
39
38
|
describeSignInError,
|
|
40
39
|
} from './accountFlowParts';
|
|
40
|
+
import { accountSecurityFallback, useAccountSecurityState } from './accountSecurityState';
|
|
41
41
|
|
|
42
42
|
/** High-contrast, un-themed on purpose: scan reliability. */
|
|
43
43
|
const QR_PLATE_BG = '#FFFFFF';
|
|
@@ -60,10 +60,9 @@ export interface OxyAuthenticatorPanelProps {
|
|
|
60
60
|
export const OxyAuthenticatorPanel: React.FC<OxyAuthenticatorPanelProps> = ({ onDone }) => {
|
|
61
61
|
const theme = useTheme();
|
|
62
62
|
const { t } = useI18n();
|
|
63
|
-
const { oxyServices
|
|
63
|
+
const { oxyServices } = useOxy();
|
|
64
64
|
const queryClient = useQueryClient();
|
|
65
|
-
const
|
|
66
|
-
const methods = useSignInMethods({ enabled: !keyed });
|
|
65
|
+
const security = useAccountSecurityState();
|
|
67
66
|
const [step, setStep] = useState<Step>({ name: 'status' });
|
|
68
67
|
const [code, setCode] = useState('');
|
|
69
68
|
const [pending, setPending] = useState(false);
|
|
@@ -72,7 +71,7 @@ export const OxyAuthenticatorPanel: React.FC<OxyAuthenticatorPanelProps> = ({ on
|
|
|
72
71
|
const refresh = () =>
|
|
73
72
|
void queryClient.invalidateQueries({ queryKey: queryKeys.signInMethods.all });
|
|
74
73
|
|
|
75
|
-
if (keyed) {
|
|
74
|
+
if (security.keyed) {
|
|
76
75
|
return (
|
|
77
76
|
<OxyAuthScreen>
|
|
78
77
|
<OxyAuthScreenHeader
|
|
@@ -82,8 +81,9 @@ export const OxyAuthenticatorPanel: React.FC<OxyAuthenticatorPanelProps> = ({ on
|
|
|
82
81
|
</OxyAuthScreen>
|
|
83
82
|
);
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
const fallback = accountSecurityFallback(security, t('signInSecurity.totp.title'), t);
|
|
85
|
+
if (fallback || !security.methods.data) return fallback;
|
|
86
|
+
const { hasEmail, hasPassword, totpEnabled, backupCodesRemaining } = security.methods.data;
|
|
87
87
|
|
|
88
88
|
const setUp = () => {
|
|
89
89
|
if (pending) return;
|
|
@@ -157,6 +157,7 @@ export const OxyAuthenticatorPanel: React.FC<OxyAuthenticatorPanelProps> = ({ on
|
|
|
157
157
|
description={t('signInSecurity.totp.scan')}
|
|
158
158
|
action="totp"
|
|
159
159
|
allowPassword={hasPassword}
|
|
160
|
+
allowEmail={hasEmail}
|
|
160
161
|
totpEnabled={false}
|
|
161
162
|
submitLabel={t('signInSecurity.totp.enable')}
|
|
162
163
|
validate={() =>
|
|
@@ -213,6 +214,7 @@ export const OxyAuthenticatorPanel: React.FC<OxyAuthenticatorPanelProps> = ({ on
|
|
|
213
214
|
description={t('signInSecurity.totp.regenerateDescription')}
|
|
214
215
|
action="totp"
|
|
215
216
|
allowPassword={hasPassword}
|
|
217
|
+
allowEmail={hasEmail}
|
|
216
218
|
totpEnabled
|
|
217
219
|
submitLabel={t('signInSecurity.totp.regenerate')}
|
|
218
220
|
onSubmit={async (reauth) => {
|
|
@@ -230,6 +232,7 @@ export const OxyAuthenticatorPanel: React.FC<OxyAuthenticatorPanelProps> = ({ on
|
|
|
230
232
|
description={t('signInSecurity.totp.description')}
|
|
231
233
|
action="totp"
|
|
232
234
|
allowPassword={hasPassword}
|
|
235
|
+
allowEmail={hasEmail}
|
|
233
236
|
totpEnabled
|
|
234
237
|
submitLabel={t('signInSecurity.totp.disable')}
|
|
235
238
|
destructive
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Deleting an account that has no key of its own, from the account's settings
|
|
3
3
|
* (the account dialog's "Manage your account", or the Accounts app):
|
|
4
4
|
*
|
|
5
|
-
* type the username → a code sent to the account's email
|
|
6
|
-
* authenticator's code when it has one) →
|
|
5
|
+
* type the username → a code sent to the account's email, or its password
|
|
6
|
+
* when it has no email (+ the authenticator's code when it has one) →
|
|
7
|
+
* deleted, and signed out
|
|
7
8
|
*
|
|
8
9
|
* An account with a Commons key is deleted with that key — in Commons, or in
|
|
9
10
|
* an app that holds it (`ManageAccountScreen`); this panel says so instead.
|
|
@@ -14,11 +15,11 @@ import type React from 'react';
|
|
|
14
15
|
import { useState } from 'react';
|
|
15
16
|
import { surfaces } from '@oxy.so/bloom/surfaces';
|
|
16
17
|
import { useOxy } from '../../context/oxyRuntimeContext';
|
|
17
|
-
import { useSignInMethods } from '../../hooks/queries/useAuthMethods';
|
|
18
18
|
import { useI18n } from '../../hooks/useI18n';
|
|
19
|
-
import {
|
|
19
|
+
import { OxyAuthScreen, OxyAuthScreenHeader } from './OxyAuthScreen';
|
|
20
20
|
import { ReauthStep } from './ReauthStep';
|
|
21
21
|
import { AccountFlowField, AccountFlowNotice } from './accountFlowParts';
|
|
22
|
+
import { accountSecurityFallback, useAccountSecurityState } from './accountSecurityState';
|
|
22
23
|
|
|
23
24
|
export interface OxyDeleteAccountPanelProps {
|
|
24
25
|
/** The account is gone and this origin signed out of it. */
|
|
@@ -33,8 +34,7 @@ export const OxyDeleteAccountPanel: React.FC<OxyDeleteAccountPanelProps> = ({
|
|
|
33
34
|
}) => {
|
|
34
35
|
const { t } = useI18n();
|
|
35
36
|
const { user, oxyServices, logout } = useOxy();
|
|
36
|
-
const
|
|
37
|
-
const methods = useSignInMethods({ enabled: !keyed });
|
|
37
|
+
const security = useAccountSecurityState();
|
|
38
38
|
const [confirmText, setConfirmText] = useState('');
|
|
39
39
|
const [deleted, setDeleted] = useState(false);
|
|
40
40
|
|
|
@@ -49,7 +49,7 @@ export const OxyDeleteAccountPanel: React.FC<OxyDeleteAccountPanelProps> = ({
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
if (keyed) {
|
|
52
|
+
if (security.keyed) {
|
|
53
53
|
return (
|
|
54
54
|
<OxyAuthScreen>
|
|
55
55
|
<OxyAuthScreenHeader title={t('deleteAccount.handoff.commonsTitle')} />
|
|
@@ -60,7 +60,9 @@ export const OxyDeleteAccountPanel: React.FC<OxyDeleteAccountPanelProps> = ({
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
const fallback = accountSecurityFallback(security, t('deleteAccount.title'), t);
|
|
64
|
+
if (fallback || !security.methods.data) return fallback;
|
|
65
|
+
const { hasEmail, totpEnabled } = security.methods.data;
|
|
64
66
|
|
|
65
67
|
const username = user?.username ?? '';
|
|
66
68
|
|
|
@@ -69,14 +71,16 @@ export const OxyDeleteAccountPanel: React.FC<OxyDeleteAccountPanelProps> = ({
|
|
|
69
71
|
title={t('deleteAccount.title')}
|
|
70
72
|
description={t('deleteAccount.keyless.subtitle', { username })}
|
|
71
73
|
action="delete_account"
|
|
72
|
-
|
|
74
|
+
// The mailbox proves it when there is one; the password only without.
|
|
75
|
+
allowPassword={!hasEmail}
|
|
76
|
+
allowEmail={hasEmail}
|
|
77
|
+
totpEnabled={totpEnabled}
|
|
73
78
|
submitLabel={t('deleteAccount.keyless.action')}
|
|
74
79
|
destructive
|
|
75
80
|
validate={() =>
|
|
76
81
|
confirmText.trim() === username ? null : t('deleteAccount.confirmLabel', { username })
|
|
77
82
|
}
|
|
78
83
|
onSubmit={async (proof) => {
|
|
79
|
-
if (!proof.emailCode) throw new Error(t('reauth.errors.invalid'));
|
|
80
84
|
// The last word before it is gone: the proof is ready, and nothing has
|
|
81
85
|
// been sent yet. Cancelling keeps the screen as it is, code and all.
|
|
82
86
|
const confirmed = await surfaces.confirm({
|
|
@@ -87,12 +91,7 @@ export const OxyDeleteAccountPanel: React.FC<OxyDeleteAccountPanelProps> = ({
|
|
|
87
91
|
destructive: true,
|
|
88
92
|
});
|
|
89
93
|
if (!confirmed) return;
|
|
90
|
-
await oxyServices.users.deleteMe(confirmText.trim(), {
|
|
91
|
-
reauth: {
|
|
92
|
-
emailCode: proof.emailCode,
|
|
93
|
-
...(proof.totpCode ? { totpCode: proof.totpCode } : {}),
|
|
94
|
-
},
|
|
95
|
-
});
|
|
94
|
+
await oxyServices.users.deleteMe(confirmText.trim(), { reauth: proof });
|
|
96
95
|
await logout().catch(() => undefined);
|
|
97
96
|
setDeleted(true);
|
|
98
97
|
onDeleted?.();
|