@oxy.so/services 6.0.0 → 6.2.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 +32 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +8 -8
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/SurfaceScreen.js +21 -12
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +1 -8
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js +11 -5
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyCreateAccountPanel.js +236 -0
- package/lib/commonjs/ui/components/signIn/OxyCreateAccountPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js +114 -0
- package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +275 -0
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyRecoverAccountPanel.js +170 -0
- package/lib/commonjs/ui/components/signIn/OxyRecoverAccountPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +45 -32
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js +244 -0
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/signInMethods.js +19 -18
- package/lib/commonjs/ui/components/signIn/signInMethods.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +4 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/passkeyFlow.js +22 -0
- package/lib/commonjs/ui/context/passkeyFlow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceFrameWidth.js +28 -0
- package/lib/commonjs/ui/hooks/useSurfaceFrameWidth.js.map +1 -0
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +0 -23
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +0 -8
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +3 -3
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/accountDeletionHandoff.js +2 -2
- package/lib/commonjs/ui/utils/accountDeletionHandoff.js.map +1 -1
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +9 -9
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/SurfaceScreen.js +21 -12
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -8
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyAuthScreen.js +11 -5
- package/lib/module/ui/components/signIn/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyCreateAccountPanel.js +231 -0
- package/lib/module/ui/components/signIn/OxyCreateAccountPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js +109 -0
- package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +270 -0
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyRecoverAccountPanel.js +165 -0
- package/lib/module/ui/components/signIn/OxyRecoverAccountPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxySignInPanel.js +47 -32
- package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/accountFlowParts.js +235 -0
- package/lib/module/ui/components/signIn/accountFlowParts.js.map +1 -0
- package/lib/module/ui/components/signIn/signInMethods.js +19 -18
- package/lib/module/ui/components/signIn/signInMethods.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +4 -4
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/passkeyFlow.js +21 -0
- package/lib/module/ui/context/passkeyFlow.js.map +1 -1
- package/lib/module/ui/hooks/useSurfaceFrameWidth.js +24 -0
- package/lib/module/ui/hooks/useSurfaceFrameWidth.js.map +1 -0
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -24
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +0 -8
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/utils/accountDeletionHandoff.js +2 -2
- package/lib/module/ui/utils/accountDeletionHandoff.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +0 -5
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts +7 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyCreateAccountPanel.d.ts +24 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyCreateAccountPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts +21 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyRecoverAccountPanel.d.ts +20 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyRecoverAccountPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts +12 -12
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts +60 -0
- package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts +18 -15
- package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +11 -5
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/passkeyFlow.d.ts +16 -1
- package/lib/typescript/commonjs/ui/context/passkeyFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSurfaceFrameWidth.d.ts +12 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceFrameWidth.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +8 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -2
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +0 -5
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts +7 -1
- package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyCreateAccountPanel.d.ts +24 -0
- package/lib/typescript/module/ui/components/signIn/OxyCreateAccountPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts +16 -0
- package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts +21 -0
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyRecoverAccountPanel.d.ts +20 -0
- package/lib/typescript/module/ui/components/signIn/OxyRecoverAccountPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts +12 -12
- package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts +60 -0
- package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts +18 -15
- package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +11 -5
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/passkeyFlow.d.ts +16 -1
- package/lib/typescript/module/ui/context/passkeyFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSurfaceFrameWidth.d.ts +12 -0
- package/lib/typescript/module/ui/hooks/useSurfaceFrameWidth.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +11 -0
- package/src/ui/components/OxyAuthChooser.tsx +9 -9
- package/src/ui/components/SurfaceScreen.tsx +19 -11
- package/src/ui/components/authChooser/AccountsMenuView.tsx +0 -7
- package/src/ui/components/authChooser/types.ts +0 -5
- package/src/ui/components/signIn/OxyAuthScreen.tsx +14 -5
- package/src/ui/components/signIn/OxyCreateAccountPanel.tsx +207 -0
- package/src/ui/components/signIn/OxyDeleteAccountPanel.tsx +106 -0
- package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +222 -0
- package/src/ui/components/signIn/OxyRecoverAccountPanel.tsx +154 -0
- package/src/ui/components/signIn/OxySignInPanel.tsx +56 -37
- package/src/ui/components/signIn/accountFlowParts.tsx +204 -0
- package/src/ui/components/signIn/signInMethods.ts +21 -17
- package/src/ui/context/OxyContext.tsx +6 -5
- package/src/ui/context/__tests__/passkeyFlow.test.ts +59 -1
- package/src/ui/context/oxyContextTypes.ts +11 -5
- package/src/ui/context/passkeyFlow.ts +28 -0
- package/src/ui/hooks/useSurfaceFrameWidth.ts +21 -0
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -27
- package/src/ui/screens/EditProfileScreen.tsx +0 -6
- package/src/ui/screens/ManageAccountScreen.tsx +3 -3
- package/src/ui/utils/accountDeletionHandoff.ts +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LoginSessionResult } from '@oxy.so/contracts';
|
|
2
3
|
import type { OxyServices, User, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView, ApiError, SessionClient, SessionMode, OxyAuthScreen } from '@oxy.so/core';
|
|
3
4
|
import type { UseFollowHook } from '../hooks/useFollow.types.js';
|
|
4
5
|
import type { useLanguageManagement } from '../hooks/useLanguageManagement.js';
|
|
@@ -100,7 +101,12 @@ export interface OxyContextState {
|
|
|
100
101
|
*/
|
|
101
102
|
removePasskey: (credentialId: string) => Promise<void>;
|
|
102
103
|
revokeSuspiciousSignIn: () => Promise<void>;
|
|
103
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Commit a session a first-party sign-in minted on THIS origin — an OAuth
|
|
106
|
+
* code exchange, or a passkey registration on auth.oxy.so (sign-up,
|
|
107
|
+
* recovery) — as the active one.
|
|
108
|
+
*/
|
|
109
|
+
handleWebSession: (session: SessionLoginResponse | LoginSessionResult) => Promise<void>;
|
|
104
110
|
/**
|
|
105
111
|
* Run a WEB third-party OAuth sign-in (authorization code + PKCE) end to end
|
|
106
112
|
* using this provider's `webAuthMode`, and commit the resulting session.
|
|
@@ -119,10 +125,10 @@ export interface OxyContextState {
|
|
|
119
125
|
*/
|
|
120
126
|
startWebOAuthSignIn: (options: StartWebOAuthSignInOptions) => Promise<WebOAuthSignInResult>;
|
|
121
127
|
/**
|
|
122
|
-
*
|
|
123
|
-
* (`recover`) in auth.oxy.so's window over the app
|
|
124
|
-
*
|
|
125
|
-
* opens with the gesture.
|
|
128
|
+
* The passkey sign-in (`signin`), account creation (`signup`) or recovery
|
|
129
|
+
* (`recover`) in auth.oxy.so's window over the app — the one step the
|
|
130
|
+
* account dialog cannot run itself, since the passkey belongs to `oxy.so`.
|
|
131
|
+
* Web only; call it from the press, so the window opens with the gesture.
|
|
126
132
|
*/
|
|
127
133
|
continueOnAuth: (screen: OxyAuthScreen) => Promise<WebOAuthSignInResult>;
|
|
128
134
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxyContextTypes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/oxyContextTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7N,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAA+B,CAAC;AAChF,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,kCAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,mBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAAyB,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE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E,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,kFAAkF;IAClF,WAAW,CAAC,EAAE,OAAO,mBAAmB,EAAE,kBAAkB,CAAC;CAC9D"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Both GATE on `isSupported()` first (the platform client returns `false`
|
|
12
12
|
* off the web) so an unsupported surface fails loudly before touching a ceremony.
|
|
13
13
|
*/
|
|
14
|
-
import type { LoginResult } from '@oxy.so/contracts';
|
|
14
|
+
import type { LoginResult, LoginSessionResult } from '@oxy.so/contracts';
|
|
15
15
|
import type { CommitInput } from './oxyContextTypes.js';
|
|
16
16
|
/**
|
|
17
17
|
* The result of `OxyServices.webauthnRegisterVerify` — either the LINK branch
|
|
@@ -74,4 +74,19 @@ export interface RunPasskeyAddDeps {
|
|
|
74
74
|
* auth-methods query). A session arm here would be a server contract violation.
|
|
75
75
|
*/
|
|
76
76
|
export declare function runPasskeyAdd(deps: RunPasskeyAddDeps): Promise<void>;
|
|
77
|
+
/** Injected dependencies for {@link runPasskeyRegisterSignIn}. */
|
|
78
|
+
export interface RunPasskeyRegisterSignInDeps {
|
|
79
|
+
isSupported: () => boolean;
|
|
80
|
+
getRegisterOptions: () => Promise<unknown>;
|
|
81
|
+
runCeremony: (optionsJSON: unknown) => Promise<unknown>;
|
|
82
|
+
registerVerify: (response: unknown) => Promise<PasskeyRegisterVerifyResult>;
|
|
83
|
+
commit: (result: LoginSessionResult) => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Register a passkey SIGNED OUT and sign in with the account it belongs to —
|
|
87
|
+
* a new passkey account (username + confirmed recovery email), or a recovery's
|
|
88
|
+
* new passkey (ADR 0029 D3). Options, ceremony, verify, then commit; the verify
|
|
89
|
+
* must mint a session, since there is no bearer to link to.
|
|
90
|
+
*/
|
|
91
|
+
export declare function runPasskeyRegisterSignIn(deps: RunPasskeyRegisterSignInDeps): Promise<void>;
|
|
77
92
|
//# sourceMappingURL=passkeyFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passkeyFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/passkeyFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"passkeyFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/passkeyFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAC;AAE3F,qFAAqF;AACrF,eAAO,MAAM,2BAA2B,gFACuC,CAAC;AAehF,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,eAAe,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,WAAW,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,WAAW,EAAE,CACX,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,KAC7E,OAAO,CAAC,WAAW,CAAC,CAAC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,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,cAAc,CAAC;AAkBtB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;aAipB++J,CAAC;YAAkC,CAAC;mBAAyC,CAAC;;aAA4C,CAAC;YAAkC,CAAC;mBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;mBAAsxC,CAAC;UAAgC,CAAC;aAAmC,CAAC;aAAmC,CAAC;;;mBAAuE,CAAC;UAAgC,CAAC;aAAmC,CAAC;aAAmC,CAAC;;;;;;;;;;EAnjBpwN,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EAuEtF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,UAAU,8BAA8B;IACtC,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC;;;;OAIG;IACH,WAAW,EAAE,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB;sBAoFf,OAAO,CAAC,eAAe,CAAC,KAAG,IAAI;2BAQpB,OAAO,CAAC,eAAe,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;sBARnD,OAAO,CAAC,eAAe,CAAC,KAAG,IAAI;2BAQpB,OAAO,CAAC,eAAe,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;sBARnD,OAAO,CAAC,eAAe,CAAC,KAAG,IAAI;2BAQpB,OAAO,CAAC,eAAe,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;sBARnD,OAAO,CAAC,eAAe,CAAC,KAAG,IAAI;2BAQpB,OAAO,CAAC,eAAe,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,cAAc,CAAC;AAkBtB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;aAipB++J,CAAC;YAAkC,CAAC;mBAAyC,CAAC;;aAA4C,CAAC;YAAkC,CAAC;mBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;mBAAsxC,CAAC;UAAgC,CAAC;aAAmC,CAAC;aAAmC,CAAC;;;mBAAuE,CAAC;UAAgC,CAAC;aAAmC,CAAC;aAAmC,CAAC;;;;;;;;;;EAnjBpwN,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EAuEtF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,UAAU,8BAA8B;IACtC,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC;;;;OAIG;IACH,WAAW,EAAE,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB;sBAoFf,OAAO,CAAC,eAAe,CAAC,KAAG,IAAI;2BAQpB,OAAO,CAAC,eAAe,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;sBARnD,OAAO,CAAC,eAAe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AO,CAAC,CAAA;KAAE,CAAC,CAAC;CACxI;AAED,4EAA4E;AAC5E,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;EAmD5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;EA+CpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,uFAoBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;UAWd,gBAAgB;iBACT,SAAS,GAAG,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAS5C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A screen's say in how wide its surface is.
|
|
3
|
+
*
|
|
4
|
+
* `SurfaceScreen` is the ONE host that declares the surface's dialog frame, so
|
|
5
|
+
* a screen whose views need different widths (the account dialog: the 420 menu,
|
|
6
|
+
* the sign-in's 880 split card) hands its width to that host rather than
|
|
7
|
+
* declaring a second frame. A change morphs the centered card to it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SurfaceFrameWidthContext: import("react").Context<((maxWidth: number | null) => void) | null>;
|
|
10
|
+
/** Ask the surface for `maxWidth` (px) while this is mounted; `null` keeps the surface's own. */
|
|
11
|
+
export declare function useSurfaceFrameWidth(maxWidth: number | null): void;
|
|
12
|
+
//# sourceMappingURL=useSurfaceFrameWidth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSurfaceFrameWidth.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSurfaceFrameWidth.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,sCAA6B,MAAM,GAAG,IAAI,KAAK,IAAI,SAAe,CAAC;AAExG,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAOlE"}
|
|
@@ -3,7 +3,7 @@ import type { BaseScreenProps } from '../types/navigation.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Field types supported by EditProfileFieldScreen
|
|
5
5
|
*/
|
|
6
|
-
export type ProfileFieldType = 'displayName' | 'username' | '
|
|
6
|
+
export type ProfileFieldType = 'displayName' | 'username' | 'bio' | 'phone' | 'address' | 'birthday' | 'location' | 'locations' | 'links';
|
|
7
7
|
interface EditProfileFieldScreenProps extends BaseScreenProps {
|
|
8
8
|
/** The field type to edit */
|
|
9
9
|
fieldType?: ProfileFieldType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditProfileFieldScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileFieldScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAStE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AA0B3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACtB,aAAa,GACb,UAAU,GACV,
|
|
1
|
+
{"version":3,"file":"EditProfileFieldScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileFieldScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAStE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AA0B3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACtB,aAAa,GACb,UAAU,GACV,KAAK,GACL,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,CAAC;AAgFd,UAAU,2BAA4B,SAAQ,eAAe;IACzD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;;AAqoBD,wBAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditProfileScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAS3D;;;;;;;;GAQG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"EditProfileScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAS3D;;;;;;;;GAQG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8GhD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.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",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
157
|
"@expo/config-plugins": "57.0.9",
|
|
158
|
-
"@oxy.so/contracts": "^2.
|
|
158
|
+
"@oxy.so/contracts": "^2.2.0",
|
|
159
159
|
"@simplewebauthn/browser": "^13.3.0",
|
|
160
160
|
"color": "^4.2.3"
|
|
161
161
|
},
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"@commitlint/cli": "^21.2.1",
|
|
165
165
|
"@commitlint/config-conventional": "^21.2.0",
|
|
166
166
|
"@expo/vector-icons": "^15.0.3",
|
|
167
|
-
"@oxy.so/core": "1.
|
|
167
|
+
"@oxy.so/core": "1.18.0",
|
|
168
168
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
169
169
|
"@react-native-community/netinfo": "^12.0.1",
|
|
170
170
|
"@react-native/babel-preset": "^0.86.2",
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"peerDependencies": {
|
|
217
217
|
"@expo/vector-icons": "^15.0.3",
|
|
218
218
|
"@oxy.so/bloom": "^4.26.0",
|
|
219
|
-
"@oxy.so/core": "^1.
|
|
219
|
+
"@oxy.so/core": "^1.18.0",
|
|
220
220
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
221
221
|
"@react-native-community/netinfo": ">=11.4.1",
|
|
222
222
|
"@tanstack/query-async-storage-persister": "^5.101",
|
package/src/index.ts
CHANGED
|
@@ -368,6 +368,17 @@ export { OxySignUpPanel } from './ui/components/signIn/OxySignUpPanel';
|
|
|
368
368
|
export type { OxySignUpPanelProps } from './ui/components/signIn/OxySignUpPanel';
|
|
369
369
|
export { OxyAccountPicker } from './ui/components/signIn/OxyAccountPicker';
|
|
370
370
|
export type { OxyAccountPickerProps } from './ui/components/signIn/OxyAccountPicker';
|
|
371
|
+
// auth.oxy.so's account pages (ADR 0029 D3): a passkey account is created,
|
|
372
|
+
// recovered through its recovery email, deleted with its passkey, and linked
|
|
373
|
+
// to Commons there.
|
|
374
|
+
export { OxyCreateAccountPanel } from './ui/components/signIn/OxyCreateAccountPanel';
|
|
375
|
+
export type { OxyCreateAccountPanelProps } from './ui/components/signIn/OxyCreateAccountPanel';
|
|
376
|
+
export { OxyRecoverAccountPanel } from './ui/components/signIn/OxyRecoverAccountPanel';
|
|
377
|
+
export type { OxyRecoverAccountPanelProps } from './ui/components/signIn/OxyRecoverAccountPanel';
|
|
378
|
+
export { OxyDeleteAccountPanel } from './ui/components/signIn/OxyDeleteAccountPanel';
|
|
379
|
+
export type { OxyDeleteAccountPanelProps } from './ui/components/signIn/OxyDeleteAccountPanel';
|
|
380
|
+
export { OxyLinkCommonsPanel } from './ui/components/signIn/OxyLinkCommonsPanel';
|
|
381
|
+
export type { OxyLinkCommonsPanelProps } from './ui/components/signIn/OxyLinkCommonsPanel';
|
|
371
382
|
export {
|
|
372
383
|
OxyAuthScreen,
|
|
373
384
|
OxyAuthScreenHeader,
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
*
|
|
17
17
|
* - `accounts` → `AccountsMenuView` — the signed-in Oxy account menu.
|
|
18
18
|
* - `add` / `signin` → `OxySignInPanel` — THE sign-in screen, the one
|
|
19
|
-
* auth.oxy.so renders too: the device's accounts, then
|
|
20
|
-
*
|
|
19
|
+
* auth.oxy.so renders too: the device's accounts, then the Commons way in
|
|
20
|
+
* (the embedded QR, or "Continue with Oxy"), then the passkey (on the web
|
|
21
|
+
* in an app, auth.oxy.so's window for that one step).
|
|
21
22
|
* - `qr` → `SignInRequestView` — the ACTIVE REQUEST: the controller-bound
|
|
22
23
|
* wiring over the shared, presentational `OxySignInRequestSurface` (the same
|
|
23
24
|
* component the auth.oxy.so IdP mounts from its OAuth-bound request). It maps
|
|
@@ -38,7 +39,7 @@ import { Linking, Platform } from 'react-native';
|
|
|
38
39
|
import { toast } from '@oxy.so/bloom/toast';
|
|
39
40
|
import { surfaces } from '@oxy.so/bloom/surfaces';
|
|
40
41
|
import { useTheme } from '@oxy.so/bloom/theme';
|
|
41
|
-
import {
|
|
42
|
+
import { getNormalizedUserHandle, type OxyAuthScreen, type User } from '@oxy.so/core';
|
|
42
43
|
import { useQueryClient } from '@tanstack/react-query';
|
|
43
44
|
import { useOxy } from '../context/OxyContext';
|
|
44
45
|
import { useDeviceSwitcher } from '../hooks/useDeviceSwitcher';
|
|
@@ -112,10 +113,10 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
112
113
|
// so the two switchers cannot drift.
|
|
113
114
|
const { principals } = useDeviceSwitcher();
|
|
114
115
|
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
116
|
+
// Sign-in happens in this dialog. On the web the passkey and account
|
|
117
|
+
// creation open auth.oxy.so's window for that one step (`continueOnAuth`):
|
|
118
|
+
// the passkey belongs to that origin. Native has no passkey path: Commons
|
|
119
|
+
// owns identity there ('none').
|
|
119
120
|
const passkeyMode = useMemo<PasskeyMode>(() => (isWebBrowser() ? 'hub' : 'none'), []);
|
|
120
121
|
|
|
121
122
|
/** auth.oxy.so's window; this surface closes once it signs the app in. */
|
|
@@ -419,7 +420,6 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
419
420
|
onSignOut: () => {
|
|
420
421
|
void handleSignOut();
|
|
421
422
|
},
|
|
422
|
-
onOpenIdentity: passkeyMode === 'hub' ? () => openUrl(`${AUTH_WEB_ORIGIN}/identity`) : undefined,
|
|
423
423
|
customItems: (consumerHooks?.menuItems ?? []).map((item) => ({
|
|
424
424
|
...item,
|
|
425
425
|
onPress: () => {
|
|
@@ -428,7 +428,7 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
428
428
|
},
|
|
429
429
|
})),
|
|
430
430
|
};
|
|
431
|
-
}, [consumerHooks, onComplete, showBottomSheet, handleSignOut, openExternal
|
|
431
|
+
}, [consumerHooks, onComplete, showBottomSheet, handleSignOut, openExternal]);
|
|
432
432
|
|
|
433
433
|
if (!controller) {
|
|
434
434
|
return null;
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
SurfaceHeaderContext,
|
|
25
25
|
type SurfaceHeaderContent,
|
|
26
26
|
} from '../hooks/useSurfaceHeader';
|
|
27
|
+
import { SurfaceFrameWidthContext } from '../hooks/useSurfaceFrameWidth';
|
|
27
28
|
import type { BaseScreenProps } from '../types/navigation';
|
|
28
29
|
|
|
29
30
|
/** Error boundary catching screen render failures, so one bad screen cannot blank the surface. */
|
|
@@ -213,17 +214,22 @@ function SurfaceScreen({
|
|
|
213
214
|
// container to a near-full-height, wider card and shrinks back on exit. Resolve
|
|
214
215
|
// its viewport-relative height to px here (the Dialog clamps to the viewport).
|
|
215
216
|
const { height: viewportHeight } = useWindowDimensions();
|
|
217
|
+
//
|
|
218
|
+
// A screen may also ask for a width of its own (`useSurfaceFrameWidth`) when
|
|
219
|
+
// its views differ in width; the width joins the frame's identity so each
|
|
220
|
+
// change morphs.
|
|
221
|
+
const [screenWidth, setScreenWidth] = useState<number | null>(null);
|
|
216
222
|
const frameSize = useMemo(() => {
|
|
217
223
|
const spec = config.frameSize;
|
|
218
|
-
if (!spec) return undefined;
|
|
224
|
+
if (!spec && screenWidth === null) return undefined;
|
|
219
225
|
const height =
|
|
220
|
-
spec
|
|
221
|
-
return { height, maxWidth: spec
|
|
222
|
-
}, [config.frameSize, viewportHeight]);
|
|
226
|
+
spec?.heightRatio !== undefined ? Math.round(viewportHeight * spec.heightRatio) : undefined;
|
|
227
|
+
return { height, maxWidth: screenWidth ?? spec?.maxWidth };
|
|
228
|
+
}, [config.frameSize, viewportHeight, screenWidth]);
|
|
223
229
|
useDialogFrame(
|
|
224
230
|
useMemo(
|
|
225
|
-
() => ({ key: `${top.route}#${top.step}`, morph: config.morph, size: frameSize }),
|
|
226
|
-
[top.route, top.step, config.morph, frameSize],
|
|
231
|
+
() => ({ key: `${top.route}#${top.step}#${screenWidth ?? ''}`, morph: config.morph, size: frameSize }),
|
|
232
|
+
[top.route, top.step, screenWidth, config.morph, frameSize],
|
|
227
233
|
),
|
|
228
234
|
);
|
|
229
235
|
// Show a back affordance whenever the surface can navigate back — either an
|
|
@@ -273,11 +279,13 @@ function SurfaceScreen({
|
|
|
273
279
|
|
|
274
280
|
return (
|
|
275
281
|
<SurfaceHeaderContext.Provider value={headerContext}>
|
|
276
|
-
<
|
|
277
|
-
<
|
|
278
|
-
<
|
|
279
|
-
|
|
280
|
-
|
|
282
|
+
<SurfaceFrameWidthContext.Provider value={setScreenWidth}>
|
|
283
|
+
<ScreenErrorBoundary screenName={top.route}>
|
|
284
|
+
<Suspense fallback={<ScreenPending />}>
|
|
285
|
+
<ScreenComponent {...screenProps} />
|
|
286
|
+
</Suspense>
|
|
287
|
+
</ScreenErrorBoundary>
|
|
288
|
+
</SurfaceFrameWidthContext.Provider>
|
|
281
289
|
</SurfaceHeaderContext.Provider>
|
|
282
290
|
);
|
|
283
291
|
}
|
|
@@ -504,13 +504,6 @@ const AccountsMenuView: React.FC<AccountsMenuViewProps> = ({
|
|
|
504
504
|
title={t('accountMenu.settings')}
|
|
505
505
|
onPress={menu.onOpenSettings}
|
|
506
506
|
/>
|
|
507
|
-
{menu.onOpenIdentity ? (
|
|
508
|
-
<SettingsListItem
|
|
509
|
-
icon={<MenuIcon name="shield-account-outline" theme={theme} />}
|
|
510
|
-
title={t('accountMenu.identity')}
|
|
511
|
-
onPress={menu.onOpenIdentity}
|
|
512
|
-
/>
|
|
513
|
-
) : null}
|
|
514
507
|
<SettingsListItem
|
|
515
508
|
icon={<MenuIcon name="help-circle-outline" theme={theme} />}
|
|
516
509
|
title={t('accountMenu.help')}
|
|
@@ -95,11 +95,6 @@ export interface AccountsMenuActions {
|
|
|
95
95
|
onPrivacy: () => void;
|
|
96
96
|
onTerms: () => void;
|
|
97
97
|
onSignOut: () => void;
|
|
98
|
-
/**
|
|
99
|
-
* Open the person's identity at auth.oxy.so/identity (recovery phrase,
|
|
100
|
-
* recovery, account deletion). Web only — `undefined` hides the row.
|
|
101
|
-
*/
|
|
102
|
-
onOpenIdentity?: () => void;
|
|
103
98
|
customItems: readonly {
|
|
104
99
|
key: string;
|
|
105
100
|
label: string;
|
|
@@ -66,20 +66,29 @@ export const OxyAuthScreen: React.FC<{ children: React.ReactNode; className?: st
|
|
|
66
66
|
<View className={`w-full max-w-[448px] self-center gap-6 ${className ?? ''}`}>{children}</View>
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
|
|
69
|
+
/**
|
|
70
|
+
* The split card: `children` on the left and, from `md`, `aside` on the right.
|
|
71
|
+
* `bare` inside a surface that already is the card (the account dialog): no
|
|
72
|
+
* border of its own, and the right column is a rounded tile within the
|
|
73
|
+
* dialog's margins.
|
|
74
|
+
*/
|
|
75
|
+
export const OxyAuthSplit: React.FC<{ children: React.ReactNode; aside: React.ReactNode; bare?: boolean }> = ({
|
|
76
|
+
children,
|
|
77
|
+
aside,
|
|
78
|
+
bare = false,
|
|
79
|
+
}) => {
|
|
71
80
|
const theme = useTheme();
|
|
72
81
|
return (
|
|
73
82
|
<View
|
|
74
|
-
className=
|
|
83
|
+
className={`w-full self-center md:max-w-[880px] md:flex-row ${bare ? 'md:gap-8' : 'md:rounded-3xl md:border md:border-border md:bg-card md:overflow-hidden'}`}
|
|
75
84
|
>
|
|
76
85
|
{/* Padding on an inner box: a padded flex item cannot shrink its base
|
|
77
86
|
size below its padding, which breaks the two equal tracks. */}
|
|
78
87
|
<View className="md:flex-1 md:basis-0 md:min-w-0">
|
|
79
|
-
<View className=
|
|
88
|
+
<View className={bare ? '' : 'md:p-8'}>{children}</View>
|
|
80
89
|
</View>
|
|
81
90
|
<View
|
|
82
|
-
className=
|
|
91
|
+
className={`hidden md:flex md:flex-1 md:basis-0 md:min-w-0 items-center justify-center overflow-hidden p-8 ${bare ? 'rounded-[20px]' : ''}`}
|
|
83
92
|
style={{ backgroundColor: theme.colors.backgroundSecondary }}
|
|
84
93
|
>
|
|
85
94
|
{aside}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creating an Oxy account on the web (ADR 0029 D3), auth.oxy.so's `/signup`:
|
|
3
|
+
*
|
|
4
|
+
* username → recovery email → the code sent to it → passkey → signed in
|
|
5
|
+
*
|
|
6
|
+
* A web account is a username, a passkey and a recovery email — no password, no
|
|
7
|
+
* phrase, no key. The email is confirmed before the account exists, and is
|
|
8
|
+
* used only to get back in (`OxyRecoverAccountPanel`). Commons stays the way to
|
|
9
|
+
* hold your own key: the first step says so, and linking Commons later makes
|
|
10
|
+
* the account self-custodied and deletes the email.
|
|
11
|
+
*
|
|
12
|
+
* Only on auth.oxy.so: the passkey belongs to that origin (RP ID `oxy.so`,
|
|
13
|
+
* asserted only there), and an app's dialog opens this page in a window
|
|
14
|
+
* (`OxySignUpPanel`'s `onCreateOnWeb`).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type React from 'react';
|
|
18
|
+
import { useState } from 'react';
|
|
19
|
+
import { Linking, Platform } from 'react-native';
|
|
20
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
21
|
+
import { toast } from '@oxy.so/bloom/toast';
|
|
22
|
+
import { DeviceManager } from '@oxy.so/core';
|
|
23
|
+
import { emailAddressSchema } from '@oxy.so/contracts';
|
|
24
|
+
import { useOxy } from '../../context/OxyContext';
|
|
25
|
+
import { runPasskeyRegisterSignIn } from '../../context/passkeyFlow';
|
|
26
|
+
import { useI18n } from '../../hooks/useI18n';
|
|
27
|
+
import { getCommonsAcquisitionUrl } from '../../utils/commonsStoreLinks';
|
|
28
|
+
import { isPasskeySupported, runRegistrationCeremony } from '../../../webauthn/passkeyClient';
|
|
29
|
+
import { SubtleLink } from '../authChooser/primitives';
|
|
30
|
+
import { OxyAuthScreen, OxyAuthScreenHeader, OxyAuthTerms } from './OxyAuthScreen';
|
|
31
|
+
import {
|
|
32
|
+
AccountFlowAction,
|
|
33
|
+
AccountFlowErrorLine,
|
|
34
|
+
AccountFlowField,
|
|
35
|
+
EmailCodeStep,
|
|
36
|
+
describeAccountFlowError,
|
|
37
|
+
isTicketExpired,
|
|
38
|
+
} from './accountFlowParts';
|
|
39
|
+
|
|
40
|
+
type Step =
|
|
41
|
+
| { name: 'username' }
|
|
42
|
+
| { name: 'email' }
|
|
43
|
+
| { name: 'code'; verificationId: string }
|
|
44
|
+
| { name: 'passkey'; emailTicket: string };
|
|
45
|
+
|
|
46
|
+
export interface OxyCreateAccountPanelProps {
|
|
47
|
+
/** The account exists and this origin is signed in as it. */
|
|
48
|
+
onSignedIn: () => void;
|
|
49
|
+
/** "Already have an account? Sign in". */
|
|
50
|
+
onSignIn: () => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const OxyCreateAccountPanel: React.FC<OxyCreateAccountPanelProps> = ({ onSignedIn, onSignIn }) => {
|
|
54
|
+
const theme = useTheme();
|
|
55
|
+
const { t } = useI18n();
|
|
56
|
+
const { oxyServices, handleWebSession } = useOxy();
|
|
57
|
+
const [step, setStep] = useState<Step>({ name: 'username' });
|
|
58
|
+
const [username, setUsername] = useState('');
|
|
59
|
+
const [email, setEmail] = useState('');
|
|
60
|
+
const [pending, setPending] = useState(false);
|
|
61
|
+
const [error, setError] = useState<string | null>(null);
|
|
62
|
+
|
|
63
|
+
const run = (work: () => Promise<void>) => {
|
|
64
|
+
if (pending) return;
|
|
65
|
+
setError(null);
|
|
66
|
+
setPending(true);
|
|
67
|
+
work()
|
|
68
|
+
.catch((reason: unknown) => {
|
|
69
|
+
if (isTicketExpired(reason)) setStep({ name: 'email' });
|
|
70
|
+
setError(describeAccountFlowError(reason, t));
|
|
71
|
+
})
|
|
72
|
+
.finally(() => setPending(false));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const submitUsername = () => {
|
|
76
|
+
const handle = username.trim();
|
|
77
|
+
if (!handle) {
|
|
78
|
+
setError(t('signup.username.required'));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
run(async () => {
|
|
82
|
+
const { available } = await oxyServices.checkUsernameAvailability(handle);
|
|
83
|
+
if (!available) throw new Error(t('signup.username.taken'));
|
|
84
|
+
setStep({ name: 'email' });
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const sendCode = async (address: string) => {
|
|
89
|
+
const { verificationId } = await oxyServices.startEmailVerification({ purpose: 'signup', email: address });
|
|
90
|
+
setStep({ name: 'code', verificationId });
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const submitEmail = () => {
|
|
94
|
+
const parsed = emailAddressSchema.safeParse(email);
|
|
95
|
+
if (!parsed.success) {
|
|
96
|
+
setError(t('signup.email.invalid'));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setEmail(parsed.data);
|
|
100
|
+
run(() => sendCode(parsed.data));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// The ceremony opens the browser's passkey prompt, so it starts from the press.
|
|
104
|
+
const createPasskey = (emailTicket: string) =>
|
|
105
|
+
run(() =>
|
|
106
|
+
runPasskeyRegisterSignIn({
|
|
107
|
+
isSupported: isPasskeySupported,
|
|
108
|
+
getRegisterOptions: () => oxyServices.webauthnRegisterOptions({ username: username.trim() }),
|
|
109
|
+
runCeremony: runRegistrationCeremony,
|
|
110
|
+
registerVerify: (response) =>
|
|
111
|
+
oxyServices.webauthnRegisterVerify(response, {
|
|
112
|
+
username: username.trim(),
|
|
113
|
+
email,
|
|
114
|
+
emailTicket,
|
|
115
|
+
deviceFingerprint: JSON.stringify(DeviceManager.getDeviceFingerprint()),
|
|
116
|
+
}),
|
|
117
|
+
commit: async (session) => {
|
|
118
|
+
await handleWebSession(session);
|
|
119
|
+
onSignedIn();
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const getCommons = () => {
|
|
125
|
+
Promise.resolve()
|
|
126
|
+
.then(() => Linking.openURL(getCommonsAcquisitionUrl(Platform.OS)))
|
|
127
|
+
.catch(() => toast.error(t('accountSwitcher.linkOpenFailed')));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
switch (step.name) {
|
|
131
|
+
case 'code':
|
|
132
|
+
return (
|
|
133
|
+
<EmailCodeStep
|
|
134
|
+
description={t('emailCode.sentTo', { email })}
|
|
135
|
+
verificationId={step.verificationId}
|
|
136
|
+
onConfirmed={({ ticket }) => {
|
|
137
|
+
setError(null);
|
|
138
|
+
setStep({ name: 'passkey', emailTicket: ticket });
|
|
139
|
+
}}
|
|
140
|
+
onResend={() => sendCode(email)}
|
|
141
|
+
back={{ label: t('emailCode.changeEmail'), onPress: () => setStep({ name: 'email' }) }}
|
|
142
|
+
/>
|
|
143
|
+
);
|
|
144
|
+
case 'passkey':
|
|
145
|
+
return (
|
|
146
|
+
<OxyAuthScreen>
|
|
147
|
+
<OxyAuthScreenHeader title={t('signup.passkey.title')} description={t('signup.passkey.subtitle')} />
|
|
148
|
+
{error ? <AccountFlowErrorLine message={error} /> : null}
|
|
149
|
+
<AccountFlowAction
|
|
150
|
+
label={t('signup.passkey.action')}
|
|
151
|
+
onPress={() => createPasskey(step.emailTicket)}
|
|
152
|
+
pending={pending}
|
|
153
|
+
testID="signup-create-passkey"
|
|
154
|
+
/>
|
|
155
|
+
<OxyAuthTerms />
|
|
156
|
+
</OxyAuthScreen>
|
|
157
|
+
);
|
|
158
|
+
case 'email':
|
|
159
|
+
return (
|
|
160
|
+
<OxyAuthScreen>
|
|
161
|
+
<OxyAuthScreenHeader title={t('signup.email.title')} description={t('signup.email.subtitle')} />
|
|
162
|
+
<AccountFlowField
|
|
163
|
+
label={t('signup.email.label')}
|
|
164
|
+
value={email}
|
|
165
|
+
onChange={(value) => {
|
|
166
|
+
setEmail(value);
|
|
167
|
+
if (error) setError(null);
|
|
168
|
+
}}
|
|
169
|
+
onSubmit={submitEmail}
|
|
170
|
+
error={error}
|
|
171
|
+
disabled={pending}
|
|
172
|
+
placeholder={t('signup.email.placeholder')}
|
|
173
|
+
autoComplete="email"
|
|
174
|
+
keyboardType="email-address"
|
|
175
|
+
testID="signup-email"
|
|
176
|
+
/>
|
|
177
|
+
<AccountFlowAction label={t('signin.actions.continue')} onPress={submitEmail} pending={pending} testID="signup-email-continue" />
|
|
178
|
+
<SubtleLink label={t('signin.actions.back')} theme={theme} onPress={() => setStep({ name: 'username' })} testID="signup-back" />
|
|
179
|
+
<OxyAuthTerms />
|
|
180
|
+
</OxyAuthScreen>
|
|
181
|
+
);
|
|
182
|
+
default:
|
|
183
|
+
return (
|
|
184
|
+
<OxyAuthScreen>
|
|
185
|
+
<OxyAuthScreenHeader title={t('signup.title')} description={t('signup.webSubtitle')} />
|
|
186
|
+
<AccountFlowField
|
|
187
|
+
label={t('signup.username.label')}
|
|
188
|
+
value={username}
|
|
189
|
+
onChange={(value) => {
|
|
190
|
+
setUsername(value);
|
|
191
|
+
if (error) setError(null);
|
|
192
|
+
}}
|
|
193
|
+
onSubmit={submitUsername}
|
|
194
|
+
error={error}
|
|
195
|
+
disabled={pending}
|
|
196
|
+
placeholder={t('signup.username.placeholder')}
|
|
197
|
+
autoComplete="username"
|
|
198
|
+
testID="signup-username"
|
|
199
|
+
/>
|
|
200
|
+
<AccountFlowAction label={t('signin.actions.continue')} onPress={submitUsername} pending={pending} testID="signup-username-continue" />
|
|
201
|
+
<SubtleLink label={t('signup.commonsInstead')} theme={theme} onPress={getCommons} testID="signup-commons-instead" />
|
|
202
|
+
<SubtleLink label={t('signup.backToSignInLink')} theme={theme} onPress={onSignIn} testID="back-to-sign-in" />
|
|
203
|
+
<OxyAuthTerms />
|
|
204
|
+
</OxyAuthScreen>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
};
|