@oxy.so/services 4.0.7 → 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.
- package/README.md +2 -2
- package/lib/commonjs/assets/assets/signIn/slide-1.jpg +0 -0
- package/lib/commonjs/assets/assets/signIn/slide-1.jpg.d.ts +3 -0
- package/lib/commonjs/assets/assets/signIn/slide-2.jpg +0 -0
- package/lib/commonjs/assets/assets/signIn/slide-2.jpg.d.ts +3 -0
- package/lib/commonjs/assets/assets/signIn/slide-3.jpg +0 -0
- package/lib/commonjs/assets/assets/signIn/slide-3.jpg.d.ts +3 -0
- package/lib/commonjs/assets/assets/signIn/slide-4.jpg +0 -0
- package/lib/commonjs/assets/assets/signIn/slide-4.jpg.d.ts +3 -0
- package/lib/commonjs/assets/signIn/slide-1.jpg +0 -0
- package/lib/commonjs/assets/signIn/slide-2.jpg +0 -0
- package/lib/commonjs/assets/signIn/slide-3.jpg +0 -0
- package/lib/commonjs/assets/signIn/slide-4.jpg +0 -0
- package/lib/commonjs/index.js +77 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +11 -58
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +36 -45
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +0 -2
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +30 -16
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +7 -52
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/signInFailureMessage.js +1 -7
- package/lib/commonjs/ui/components/authChooser/signInFailureMessage.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/styles.js +0 -31
- package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js +2 -2
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/oauthNavigation.js +1 -1
- package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js +161 -0
- package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyAccountPicker.js +111 -0
- package/lib/commonjs/ui/components/signIn/OxyAccountPicker.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js +160 -0
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js.map +1 -0
- 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 +371 -0
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js +78 -0
- package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js.map +1 -0
- 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/artwork.js +21 -0
- package/lib/commonjs/ui/components/signIn/artwork.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/passkeyError.js +46 -0
- package/lib/commonjs/ui/components/signIn/passkeyError.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/signInMethods.js +46 -0
- package/lib/commonjs/ui/components/signIn/signInMethods.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +16 -16
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +0 -43
- package/lib/commonjs/ui/context/commitSessionFlow.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/accountDialogSnapshot.js +15 -1
- package/lib/commonjs/ui/hooks/accountDialogSnapshot.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceSwitcher.js +1 -3
- package/lib/commonjs/ui/hooks/useDeviceSwitcher.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +11 -4
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/commonjs/ui/oauth/oauthHandshake.js +3 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -1
- package/lib/commonjs/ui/oauth/oauthPopup.js +2 -3
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
- 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 -4
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/session/authStore.js +0 -21
- package/lib/commonjs/ui/session/authStore.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/assets/assets/signIn/slide-1.jpg +0 -0
- package/lib/module/assets/assets/signIn/slide-1.jpg.d.ts +3 -0
- package/lib/module/assets/assets/signIn/slide-2.jpg +0 -0
- package/lib/module/assets/assets/signIn/slide-2.jpg.d.ts +3 -0
- package/lib/module/assets/assets/signIn/slide-3.jpg +0 -0
- package/lib/module/assets/assets/signIn/slide-3.jpg.d.ts +3 -0
- package/lib/module/assets/assets/signIn/slide-4.jpg +0 -0
- package/lib/module/assets/assets/signIn/slide-4.jpg.d.ts +3 -0
- package/lib/module/assets/signIn/slide-1.jpg +0 -0
- package/lib/module/assets/signIn/slide-2.jpg +0 -0
- package/lib/module/assets/signIn/slide-3.jpg +0 -0
- package/lib/module/assets/signIn/slide-4.jpg +0 -0
- package/lib/module/index.js +14 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +14 -59
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +37 -46
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +0 -2
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +22 -10
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/primitives.js +1 -44
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/authChooser/signInFailureMessage.js +1 -7
- package/lib/module/ui/components/authChooser/signInFailureMessage.js.map +1 -1
- package/lib/module/ui/components/authChooser/styles.js +0 -31
- package/lib/module/ui/components/authChooser/styles.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js +2 -2
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/oauthNavigation.js +1 -1
- package/lib/module/ui/components/signIn/InlineCommonsQr.js +157 -0
- package/lib/module/ui/components/signIn/InlineCommonsQr.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyAccountPicker.js +106 -0
- package/lib/module/ui/components/signIn/OxyAccountPicker.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyAuthScreen.js +151 -0
- package/lib/module/ui/components/signIn/OxyAuthScreen.js.map +1 -0
- 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 +366 -0
- package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxySignUpPanel.js +75 -0
- package/lib/module/ui/components/signIn/OxySignUpPanel.js.map +1 -0
- 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/artwork.js +16 -0
- package/lib/module/ui/components/signIn/artwork.js.map +1 -0
- package/lib/module/ui/components/signIn/passkeyError.js +40 -0
- package/lib/module/ui/components/signIn/passkeyError.js.map +1 -0
- package/lib/module/ui/components/signIn/signInMethods.js +42 -0
- package/lib/module/ui/components/signIn/signInMethods.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +17 -17
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +0 -42
- package/lib/module/ui/context/commitSessionFlow.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/accountDialogSnapshot.js +14 -1
- package/lib/module/ui/hooks/accountDialogSnapshot.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceSwitcher.js +3 -5
- package/lib/module/ui/hooks/useDeviceSwitcher.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +11 -4
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/module/ui/oauth/oauthHandshake.js +3 -0
- package/lib/module/ui/oauth/oauthHandshake.js.map +1 -1
- package/lib/module/ui/oauth/oauthPopup.js +2 -3
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
- 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 +4 -5
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/session/authStore.js +1 -22
- package/lib/module/ui/session/authStore.js.map +1 -1
- package/lib/module/ui/utils/accountDeletionHandoff.js +3 -3
- package/lib/module/ui/utils/accountDeletionHandoff.js.map +1 -1
- package/lib/typescript/assets/signIn/slide-1.jpg.d.ts +3 -0
- package/lib/typescript/assets/signIn/slide-2.jpg.d.ts +3 -0
- package/lib/typescript/assets/signIn/slide-3.jpg.d.ts +3 -0
- package/lib/typescript/assets/signIn/slide-4.jpg.d.ts +3 -0
- package/lib/typescript/commonjs/index.d.ts +16 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +5 -12
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.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/primitives.d.ts +0 -19
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/signInFailureMessage.d.ts +1 -5
- package/lib/typescript/commonjs/ui/components/authChooser/signInFailureMessage.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts +0 -31
- package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +2 -7
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts +20 -0
- package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyAccountPicker.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyAccountPicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts +43 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -0
- 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 +43 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts +17 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -0
- 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/artwork.d.ts +8 -0
- package/lib/typescript/commonjs/ui/components/signIn/artwork.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/passkeyError.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/signIn/passkeyError.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts +39 -0
- package/lib/typescript/commonjs/ui/components/signIn/signInMethods.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +15 -10
- 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/accountDialogSnapshot.d.ts +7 -1
- package/lib/typescript/commonjs/ui/hooks/accountDialogSnapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useDeviceSwitcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +9 -0
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +3 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +2 -3
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
- 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/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/authStore.d.ts +0 -30
- package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +0 -26
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +16 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +5 -12
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.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/primitives.d.ts +0 -19
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/signInFailureMessage.d.ts +1 -5
- package/lib/typescript/module/ui/components/authChooser/signInFailureMessage.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/styles.d.ts +0 -31
- package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +2 -7
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/oauthNavigation.d.ts +1 -1
- package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts +20 -0
- package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyAccountPicker.d.ts +34 -0
- package/lib/typescript/module/ui/components/signIn/OxyAccountPicker.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts +43 -0
- package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -0
- 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 +43 -0
- package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts +17 -0
- package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -0
- 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/artwork.d.ts +8 -0
- package/lib/typescript/module/ui/components/signIn/artwork.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/passkeyError.d.ts +16 -0
- package/lib/typescript/module/ui/components/signIn/passkeyError.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts +39 -0
- package/lib/typescript/module/ui/components/signIn/signInMethods.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +15 -10
- 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/accountDialogSnapshot.d.ts +7 -1
- package/lib/typescript/module/ui/hooks/accountDialogSnapshot.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useDeviceSwitcher.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +9 -0
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +3 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +2 -3
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
- 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/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/authStore.d.ts +0 -30
- package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +0 -26
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/package.json +4 -7
- package/src/assets/signIn/slide-1.jpg +0 -0
- package/src/assets/signIn/slide-1.jpg.d.ts +3 -0
- package/src/assets/signIn/slide-2.jpg +0 -0
- package/src/assets/signIn/slide-2.jpg.d.ts +3 -0
- package/src/assets/signIn/slide-3.jpg +0 -0
- package/src/assets/signIn/slide-3.jpg.d.ts +3 -0
- package/src/assets/signIn/slide-4.jpg +0 -0
- package/src/assets/signIn/slide-4.jpg.d.ts +3 -0
- package/src/index.ts +27 -7
- package/src/ui/components/OxyAccountDialogScreen.tsx +11 -72
- package/src/ui/components/OxyAuthChooser.tsx +37 -54
- package/src/ui/components/OxyProvider.tsx +0 -2
- package/src/ui/components/ProfileButton.tsx +1 -4
- package/src/ui/components/authChooser/AccountsMenuView.tsx +28 -8
- package/src/ui/components/authChooser/primitives.tsx +1 -39
- package/src/ui/components/authChooser/signInFailureMessage.ts +1 -7
- package/src/ui/components/authChooser/styles.ts +0 -31
- package/src/ui/components/authChooser/types.ts +2 -7
- package/src/ui/components/oauthNavigation.ts +1 -1
- package/src/ui/components/signIn/InlineCommonsQr.tsx +135 -0
- package/src/ui/components/signIn/OxyAccountPicker.tsx +129 -0
- package/src/ui/components/signIn/OxyAuthScreen.tsx +123 -0
- 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 +392 -0
- package/src/ui/components/signIn/OxySignUpPanel.tsx +86 -0
- package/src/ui/components/signIn/accountFlowParts.tsx +204 -0
- package/src/ui/components/signIn/artwork.ts +13 -0
- package/src/ui/components/signIn/passkeyError.ts +44 -0
- package/src/ui/components/signIn/signInMethods.ts +51 -0
- package/src/ui/context/OxyContext.tsx +23 -19
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
- package/src/ui/context/__tests__/passkeyFlow.test.ts +59 -1
- package/src/ui/context/commitSessionFlow.ts +0 -61
- package/src/ui/context/oxyContextTypes.ts +16 -10
- package/src/ui/context/passkeyFlow.ts +28 -0
- package/src/ui/hooks/accountDialogSnapshot.ts +20 -1
- package/src/ui/hooks/useDeviceSwitcher.ts +3 -11
- package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +21 -0
- package/src/ui/oauth/browserAuthTransport.ts +14 -4
- package/src/ui/oauth/oauthHandshake.ts +4 -1
- package/src/ui/oauth/oauthPopup.ts +2 -3
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -27
- package/src/ui/screens/EditProfileScreen.tsx +0 -6
- package/src/ui/screens/ManageAccountScreen.tsx +4 -5
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +1 -1
- package/src/ui/session/authStore.ts +0 -37
- package/src/ui/types/navigation.ts +0 -26
- package/src/ui/utils/accountDeletionHandoff.ts +3 -3
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +0 -132
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +0 -1
- package/lib/commonjs/ui/components/authChooser/SignUpView.js +0 -77
- package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +0 -1
- package/lib/commonjs/ui/components/passkeyHubPopup.js +0 -33
- package/lib/commonjs/ui/components/passkeyHubPopup.js.map +0 -1
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/module/ui/components/authChooser/SignInEntryView.js +0 -127
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +0 -1
- package/lib/module/ui/components/authChooser/SignUpView.js +0 -73
- package/lib/module/ui/components/authChooser/SignUpView.js.map +0 -1
- package/lib/module/ui/components/passkeyHubPopup.js +0 -29
- package/lib/module/ui/components/passkeyHubPopup.js.map +0 -1
- package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +0 -39
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +0 -31
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/passkeyHubPopup.d.ts +0 -23
- package/lib/typescript/commonjs/ui/components/passkeyHubPopup.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +0 -39
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +0 -31
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/passkeyHubPopup.d.ts +0 -23
- package/lib/typescript/module/ui/components/passkeyHubPopup.d.ts.map +0 -1
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/src/ui/components/authChooser/SignInEntryView.tsx +0 -157
- package/src/ui/components/authChooser/SignUpView.tsx +0 -76
- package/src/ui/components/passkeyHubPopup.ts +0 -28
- package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shell every Oxy sign-in screen shares — the in-app account dialog and
|
|
5
|
+
* every page of the auth.oxy.so IdP render these, so the two cannot drift:
|
|
6
|
+
*
|
|
7
|
+
* header the Oxy mark (56), then the title (48/800, tight) and a 18px
|
|
8
|
+
* description, 8 apart
|
|
9
|
+
* screen blocks 24 apart, at most 448 wide
|
|
10
|
+
* split from `md`, Bloom `AuthCard`'s split base — max 880, radius 24,
|
|
11
|
+
* 1px border, two equal columns, the right one on the secondary
|
|
12
|
+
* surface; below `md` the right column is dropped, not stacked
|
|
13
|
+
* loading an indeterminate spinner holding the screen's height
|
|
14
|
+
* terms one centred caption linking the Terms of Service and Privacy Policy
|
|
15
|
+
*
|
|
16
|
+
* Layout is NativeWind `className` (breakpoints included). Type stays on
|
|
17
|
+
* Bloom `Text`'s own ramp through `style` — a `className` there drops its
|
|
18
|
+
* default family — and colours come from the Bloom theme.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { ActivityIndicator, Linking, Text as RNText } from 'react-native';
|
|
22
|
+
import { View } from 'react-native-css/components';
|
|
23
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
24
|
+
import { Text } from '@oxy.so/bloom/typography';
|
|
25
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
26
|
+
import { LogoIcon } from "../logo/LogoIcon.js";
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
const LOGO_HEIGHT = 56;
|
|
29
|
+
const TERMS_URL = 'https://oxy.so/company/transparency/policies/terms-of-service';
|
|
30
|
+
const PRIVACY_URL = 'https://oxy.so/company/transparency/policies/privacy';
|
|
31
|
+
const TITLE = {
|
|
32
|
+
fontSize: 48,
|
|
33
|
+
lineHeight: 48,
|
|
34
|
+
fontWeight: '800',
|
|
35
|
+
letterSpacing: -1.2
|
|
36
|
+
};
|
|
37
|
+
const DESCRIPTION = {
|
|
38
|
+
fontSize: 18,
|
|
39
|
+
lineHeight: 28
|
|
40
|
+
};
|
|
41
|
+
const TERMS = {
|
|
42
|
+
fontSize: 14,
|
|
43
|
+
lineHeight: 20,
|
|
44
|
+
textAlign: 'center',
|
|
45
|
+
paddingHorizontal: 24
|
|
46
|
+
};
|
|
47
|
+
/** The Oxy mark over the screen's title and description. */
|
|
48
|
+
export const OxyAuthScreenHeader = ({
|
|
49
|
+
title,
|
|
50
|
+
description
|
|
51
|
+
}) => {
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
54
|
+
className: "gap-6",
|
|
55
|
+
children: [/*#__PURE__*/_jsx(LogoIcon, {
|
|
56
|
+
height: LOGO_HEIGHT
|
|
57
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
58
|
+
className: "max-w-[90%] gap-2",
|
|
59
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
60
|
+
accessibilityRole: "header",
|
|
61
|
+
style: [TITLE, {
|
|
62
|
+
color: theme.colors.text
|
|
63
|
+
}],
|
|
64
|
+
children: title
|
|
65
|
+
}), description != null && description !== '' ? typeof description === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
66
|
+
style: [DESCRIPTION, {
|
|
67
|
+
color: theme.colors.textSecondary
|
|
68
|
+
}],
|
|
69
|
+
children: description
|
|
70
|
+
}) : description : null]
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** A sign-in screen's column: its blocks 24 apart. `className` extends it (the split's form column). */
|
|
76
|
+
export const OxyAuthScreen = ({
|
|
77
|
+
children,
|
|
78
|
+
className
|
|
79
|
+
}) => /*#__PURE__*/_jsx(View, {
|
|
80
|
+
className: `w-full max-w-[448px] self-center gap-6 ${className ?? ''}`,
|
|
81
|
+
children: children
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/** The split card: `children` on the left and, from `md`, `aside` on the right. */
|
|
85
|
+
export const OxyAuthSplit = ({
|
|
86
|
+
children,
|
|
87
|
+
aside
|
|
88
|
+
}) => {
|
|
89
|
+
const theme = useTheme();
|
|
90
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
91
|
+
className: "w-full self-center md:max-w-[880px] md:flex-row md:rounded-3xl md:border md:border-border md:bg-card md:overflow-hidden",
|
|
92
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
93
|
+
className: "md:flex-1 md:basis-0 md:min-w-0",
|
|
94
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
95
|
+
className: "md:p-8",
|
|
96
|
+
children: children
|
|
97
|
+
})
|
|
98
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
99
|
+
className: "hidden md:flex md:flex-1 md:basis-0 md:min-w-0 items-center justify-center overflow-hidden p-8",
|
|
100
|
+
style: {
|
|
101
|
+
backgroundColor: theme.colors.backgroundSecondary
|
|
102
|
+
},
|
|
103
|
+
children: aside
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The screen while there is nothing to show yet. React Native's own indicator:
|
|
110
|
+
* `@oxy.so/bloom/loading` can tree-shake to `undefined` in a rolldown-vite
|
|
111
|
+
* production bundle when co-imported with `@oxy.so/bloom/button`.
|
|
112
|
+
*/
|
|
113
|
+
export const OxyAuthLoading = () => {
|
|
114
|
+
const theme = useTheme();
|
|
115
|
+
return /*#__PURE__*/_jsx(View, {
|
|
116
|
+
className: "min-h-[300px] items-center justify-center",
|
|
117
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
118
|
+
size: "large",
|
|
119
|
+
color: theme.colors.primary
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** "By continuing, you agree to our Terms of Service and Privacy Policy." */
|
|
125
|
+
export const OxyAuthTerms = () => {
|
|
126
|
+
const theme = useTheme();
|
|
127
|
+
const {
|
|
128
|
+
t
|
|
129
|
+
} = useI18n();
|
|
130
|
+
const link = {
|
|
131
|
+
color: theme.colors.text,
|
|
132
|
+
textDecorationLine: 'underline'
|
|
133
|
+
};
|
|
134
|
+
return /*#__PURE__*/_jsxs(Text, {
|
|
135
|
+
style: [TERMS, {
|
|
136
|
+
color: theme.colors.textSecondary
|
|
137
|
+
}],
|
|
138
|
+
children: [t('signin.terms.before'), ' ', /*#__PURE__*/_jsx(RNText, {
|
|
139
|
+
accessibilityRole: "link",
|
|
140
|
+
style: link,
|
|
141
|
+
onPress: () => void Linking.openURL(TERMS_URL),
|
|
142
|
+
children: t('signin.terms.termsLink')
|
|
143
|
+
}), ' ', t('signin.terms.and'), ' ', /*#__PURE__*/_jsx(RNText, {
|
|
144
|
+
accessibilityRole: "link",
|
|
145
|
+
style: link,
|
|
146
|
+
onPress: () => void Linking.openURL(PRIVACY_URL),
|
|
147
|
+
children: t('signin.terms.privacyLink')
|
|
148
|
+
}), "."]
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=OxyAuthScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ActivityIndicator","Linking","Text","RNText","View","useTheme","useI18n","LogoIcon","jsx","_jsx","jsxs","_jsxs","LOGO_HEIGHT","TERMS_URL","PRIVACY_URL","TITLE","fontSize","lineHeight","fontWeight","letterSpacing","DESCRIPTION","TERMS","textAlign","paddingHorizontal","OxyAuthScreenHeader","title","description","theme","className","children","height","accessibilityRole","style","color","colors","text","textSecondary","OxyAuthScreen","OxyAuthSplit","aside","backgroundColor","backgroundSecondary","OxyAuthLoading","size","primary","OxyAuthTerms","t","link","textDecorationLine","onPress","openURL"],"sourceRoot":"../../../../../src","sources":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AAEA,CAAA,KAAM,KAAKhD,OAAO,CAACiD,OAAO,CAACpC,WAAW,CAAE;MAAAe,QAAA,EAC5FiB,CAAC,CAAC,0BAA0B;IAAC,CACxB,CAAC,KAEX;EAAA,CAAM,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creating an Oxy account on the web (ADR 0029 D3), auth.oxy.so's `/signup`:
|
|
5
|
+
*
|
|
6
|
+
* username → recovery email → the code sent to it → passkey → signed in
|
|
7
|
+
*
|
|
8
|
+
* A web account is a username, a passkey and a recovery email — no password, no
|
|
9
|
+
* phrase, no key. The email is confirmed before the account exists, and is
|
|
10
|
+
* used only to get back in (`OxyRecoverAccountPanel`). Commons stays the way to
|
|
11
|
+
* hold your own key: the first step says so, and linking Commons later makes
|
|
12
|
+
* the account self-custodied and deletes the email.
|
|
13
|
+
*
|
|
14
|
+
* Only on auth.oxy.so: the passkey belongs to that origin (RP ID `oxy.so`,
|
|
15
|
+
* asserted only there), and an app's dialog opens this page in a window
|
|
16
|
+
* (`OxySignUpPanel`'s `onCreateOnWeb`).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { useState } from 'react';
|
|
20
|
+
import { Linking, Platform } from 'react-native';
|
|
21
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
22
|
+
import { toast } from '@oxy.so/bloom/toast';
|
|
23
|
+
import { DeviceManager } from '@oxy.so/core';
|
|
24
|
+
import { emailAddressSchema } from '@oxy.so/contracts';
|
|
25
|
+
import { useOxy } from "../../context/OxyContext.js";
|
|
26
|
+
import { runPasskeyRegisterSignIn } from "../../context/passkeyFlow.js";
|
|
27
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
28
|
+
import { getCommonsAcquisitionUrl } from "../../utils/commonsStoreLinks.js";
|
|
29
|
+
import { isPasskeySupported, runRegistrationCeremony } from '../../../webauthn/passkeyClient';
|
|
30
|
+
import { SubtleLink } from "../authChooser/primitives.js";
|
|
31
|
+
import { OxyAuthScreen, OxyAuthScreenHeader, OxyAuthTerms } from "./OxyAuthScreen.js";
|
|
32
|
+
import { AccountFlowAction, AccountFlowErrorLine, AccountFlowField, EmailCodeStep, describeAccountFlowError, isTicketExpired } from "./accountFlowParts.js";
|
|
33
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
+
export const OxyCreateAccountPanel = ({
|
|
35
|
+
onSignedIn,
|
|
36
|
+
onSignIn
|
|
37
|
+
}) => {
|
|
38
|
+
const theme = useTheme();
|
|
39
|
+
const {
|
|
40
|
+
t
|
|
41
|
+
} = useI18n();
|
|
42
|
+
const {
|
|
43
|
+
oxyServices,
|
|
44
|
+
handleWebSession
|
|
45
|
+
} = useOxy();
|
|
46
|
+
const [step, setStep] = useState({
|
|
47
|
+
name: 'username'
|
|
48
|
+
});
|
|
49
|
+
const [username, setUsername] = useState('');
|
|
50
|
+
const [email, setEmail] = useState('');
|
|
51
|
+
const [pending, setPending] = useState(false);
|
|
52
|
+
const [error, setError] = useState(null);
|
|
53
|
+
const run = work => {
|
|
54
|
+
if (pending) return;
|
|
55
|
+
setError(null);
|
|
56
|
+
setPending(true);
|
|
57
|
+
work().catch(reason => {
|
|
58
|
+
if (isTicketExpired(reason)) setStep({
|
|
59
|
+
name: 'email'
|
|
60
|
+
});
|
|
61
|
+
setError(describeAccountFlowError(reason, t));
|
|
62
|
+
}).finally(() => setPending(false));
|
|
63
|
+
};
|
|
64
|
+
const submitUsername = () => {
|
|
65
|
+
const handle = username.trim();
|
|
66
|
+
if (!handle) {
|
|
67
|
+
setError(t('signup.username.required'));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
run(async () => {
|
|
71
|
+
const {
|
|
72
|
+
available
|
|
73
|
+
} = await oxyServices.checkUsernameAvailability(handle);
|
|
74
|
+
if (!available) throw new Error(t('signup.username.taken'));
|
|
75
|
+
setStep({
|
|
76
|
+
name: 'email'
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
const sendCode = async address => {
|
|
81
|
+
const {
|
|
82
|
+
verificationId
|
|
83
|
+
} = await oxyServices.startEmailVerification({
|
|
84
|
+
purpose: 'signup',
|
|
85
|
+
email: address
|
|
86
|
+
});
|
|
87
|
+
setStep({
|
|
88
|
+
name: 'code',
|
|
89
|
+
verificationId
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const submitEmail = () => {
|
|
93
|
+
const parsed = emailAddressSchema.safeParse(email);
|
|
94
|
+
if (!parsed.success) {
|
|
95
|
+
setError(t('signup.email.invalid'));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
setEmail(parsed.data);
|
|
99
|
+
run(() => sendCode(parsed.data));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// The ceremony opens the browser's passkey prompt, so it starts from the press.
|
|
103
|
+
const createPasskey = emailTicket => run(() => runPasskeyRegisterSignIn({
|
|
104
|
+
isSupported: isPasskeySupported,
|
|
105
|
+
getRegisterOptions: () => oxyServices.webauthnRegisterOptions({
|
|
106
|
+
username: username.trim()
|
|
107
|
+
}),
|
|
108
|
+
runCeremony: runRegistrationCeremony,
|
|
109
|
+
registerVerify: response => oxyServices.webauthnRegisterVerify(response, {
|
|
110
|
+
username: username.trim(),
|
|
111
|
+
email,
|
|
112
|
+
emailTicket,
|
|
113
|
+
deviceFingerprint: JSON.stringify(DeviceManager.getDeviceFingerprint())
|
|
114
|
+
}),
|
|
115
|
+
commit: async session => {
|
|
116
|
+
await handleWebSession(session);
|
|
117
|
+
onSignedIn();
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
const getCommons = () => {
|
|
121
|
+
Promise.resolve().then(() => Linking.openURL(getCommonsAcquisitionUrl(Platform.OS))).catch(() => toast.error(t('accountSwitcher.linkOpenFailed')));
|
|
122
|
+
};
|
|
123
|
+
switch (step.name) {
|
|
124
|
+
case 'code':
|
|
125
|
+
return /*#__PURE__*/_jsx(EmailCodeStep, {
|
|
126
|
+
description: t('emailCode.sentTo', {
|
|
127
|
+
email
|
|
128
|
+
}),
|
|
129
|
+
verificationId: step.verificationId,
|
|
130
|
+
onConfirmed: ({
|
|
131
|
+
ticket
|
|
132
|
+
}) => {
|
|
133
|
+
setError(null);
|
|
134
|
+
setStep({
|
|
135
|
+
name: 'passkey',
|
|
136
|
+
emailTicket: ticket
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
onResend: () => sendCode(email),
|
|
140
|
+
back: {
|
|
141
|
+
label: t('emailCode.changeEmail'),
|
|
142
|
+
onPress: () => setStep({
|
|
143
|
+
name: 'email'
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
case 'passkey':
|
|
148
|
+
return /*#__PURE__*/_jsxs(OxyAuthScreen, {
|
|
149
|
+
children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
150
|
+
title: t('signup.passkey.title'),
|
|
151
|
+
description: t('signup.passkey.subtitle')
|
|
152
|
+
}), error ? /*#__PURE__*/_jsx(AccountFlowErrorLine, {
|
|
153
|
+
message: error
|
|
154
|
+
}) : null, /*#__PURE__*/_jsx(AccountFlowAction, {
|
|
155
|
+
label: t('signup.passkey.action'),
|
|
156
|
+
onPress: () => createPasskey(step.emailTicket),
|
|
157
|
+
pending: pending,
|
|
158
|
+
testID: "signup-create-passkey"
|
|
159
|
+
}), /*#__PURE__*/_jsx(OxyAuthTerms, {})]
|
|
160
|
+
});
|
|
161
|
+
case 'email':
|
|
162
|
+
return /*#__PURE__*/_jsxs(OxyAuthScreen, {
|
|
163
|
+
children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
164
|
+
title: t('signup.email.title'),
|
|
165
|
+
description: t('signup.email.subtitle')
|
|
166
|
+
}), /*#__PURE__*/_jsx(AccountFlowField, {
|
|
167
|
+
label: t('signup.email.label'),
|
|
168
|
+
value: email,
|
|
169
|
+
onChange: value => {
|
|
170
|
+
setEmail(value);
|
|
171
|
+
if (error) setError(null);
|
|
172
|
+
},
|
|
173
|
+
onSubmit: submitEmail,
|
|
174
|
+
error: error,
|
|
175
|
+
disabled: pending,
|
|
176
|
+
placeholder: t('signup.email.placeholder'),
|
|
177
|
+
autoComplete: "email",
|
|
178
|
+
keyboardType: "email-address",
|
|
179
|
+
testID: "signup-email"
|
|
180
|
+
}), /*#__PURE__*/_jsx(AccountFlowAction, {
|
|
181
|
+
label: t('signin.actions.continue'),
|
|
182
|
+
onPress: submitEmail,
|
|
183
|
+
pending: pending,
|
|
184
|
+
testID: "signup-email-continue"
|
|
185
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
186
|
+
label: t('signin.actions.back'),
|
|
187
|
+
theme: theme,
|
|
188
|
+
onPress: () => setStep({
|
|
189
|
+
name: 'username'
|
|
190
|
+
}),
|
|
191
|
+
testID: "signup-back"
|
|
192
|
+
}), /*#__PURE__*/_jsx(OxyAuthTerms, {})]
|
|
193
|
+
});
|
|
194
|
+
default:
|
|
195
|
+
return /*#__PURE__*/_jsxs(OxyAuthScreen, {
|
|
196
|
+
children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
197
|
+
title: t('signup.title'),
|
|
198
|
+
description: t('signup.webSubtitle')
|
|
199
|
+
}), /*#__PURE__*/_jsx(AccountFlowField, {
|
|
200
|
+
label: t('signup.username.label'),
|
|
201
|
+
value: username,
|
|
202
|
+
onChange: value => {
|
|
203
|
+
setUsername(value);
|
|
204
|
+
if (error) setError(null);
|
|
205
|
+
},
|
|
206
|
+
onSubmit: submitUsername,
|
|
207
|
+
error: error,
|
|
208
|
+
disabled: pending,
|
|
209
|
+
placeholder: t('signup.username.placeholder'),
|
|
210
|
+
autoComplete: "username",
|
|
211
|
+
testID: "signup-username"
|
|
212
|
+
}), /*#__PURE__*/_jsx(AccountFlowAction, {
|
|
213
|
+
label: t('signin.actions.continue'),
|
|
214
|
+
onPress: submitUsername,
|
|
215
|
+
pending: pending,
|
|
216
|
+
testID: "signup-username-continue"
|
|
217
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
218
|
+
label: t('signup.commonsInstead'),
|
|
219
|
+
theme: theme,
|
|
220
|
+
onPress: getCommons,
|
|
221
|
+
testID: "signup-commons-instead"
|
|
222
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
223
|
+
label: t('signup.backToSignInLink'),
|
|
224
|
+
theme: theme,
|
|
225
|
+
onPress: onSignIn,
|
|
226
|
+
testID: "back-to-sign-in"
|
|
227
|
+
}), /*#__PURE__*/_jsx(OxyAuthTerms, {})]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
//# sourceMappingURL=OxyCreateAccountPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","Linking","Platform","useTheme","toast","DeviceManager","emailAddressSchema","useOxy","runPasskeyRegisterSignIn","useI18n","getCommonsAcquisitionUrl","isPasskeySupported","runRegistrationCeremony","SubtleLink","OxyAuthScreen","OxyAuthScreenHeader","OxyAuthTerms","AccountFlowAction","AccountFlowErrorLine","AccountFlowField","EmailCodeStep","describeAccountFlowError","isTicketExpired","jsx","_jsx","jsxs","_jsxs","OxyCreateAccountPanel","onSignedIn","onSignIn","theme","t","oxyServices","handleWebSession","step","setStep","name","username","setUsername","email","setEmail","pending","setPending","error","setError","run","work","catch","reason","finally","submitUsername","handle","trim","available","checkUsernameAvailability","Error","sendCode","address","verificationId","startEmailVerification","purpose","submitEmail","parsed","safeParse","success","data","createPasskey","emailTicket","isSupported","getRegisterOptions","webauthnRegisterOptions","runCeremony","registerVerify","response","webauthnRegisterVerify","deviceFingerprint","JSON","stringify","getDeviceFingerprint","commit","session","getCommons","Promise","resolve","then","openURL","OS","description","onConfirmed","ticket","onResend","back","label","onPress","children","title","message","testID","value","onChange","onSubmit","disabled","placeholder","autoComplete","keyboardType"],"sourceRoot":"../../../../../src","sources":["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,MAAM,EAAC;QAAiB,CAAE,CAAC,eAC7GzE,IAAA,CAACR,YAAY,IAAE,CAAC;MAAA,CACH,CAAC;EAEtB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Deleting a passkey account (ADR 0029 D3), auth.oxy.so's `/delete-account`.
|
|
5
|
+
*
|
|
6
|
+
* A passkey account has no key to sign its deletion with, so the person types
|
|
7
|
+
* the username and asserts one of the account's passkeys — on auth.oxy.so, the
|
|
8
|
+
* one origin that asserts them — over a challenge the API minted for the
|
|
9
|
+
* account. An account with a Commons key is deleted in Commons, with its key.
|
|
10
|
+
* The page must be signed in as the account; the host renders sign-in first.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import { useOxy } from "../../context/OxyContext.js";
|
|
15
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
16
|
+
import { isPasskeySupported, runAuthenticationCeremony } from '../../../webauthn/passkeyClient';
|
|
17
|
+
import { PASSKEY_UNSUPPORTED_MESSAGE } from "../../context/passkeyFlow.js";
|
|
18
|
+
import { OxyAuthScreen, OxyAuthScreenHeader } from "./OxyAuthScreen.js";
|
|
19
|
+
import { AccountFlowAction, AccountFlowErrorLine, AccountFlowField, AccountFlowNote, describeAccountFlowError } from "./accountFlowParts.js";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
export const OxyDeleteAccountPanel = ({
|
|
22
|
+
onDeleted
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
t
|
|
26
|
+
} = useI18n();
|
|
27
|
+
const {
|
|
28
|
+
user,
|
|
29
|
+
oxyServices,
|
|
30
|
+
logout
|
|
31
|
+
} = useOxy();
|
|
32
|
+
const [confirmText, setConfirmText] = useState('');
|
|
33
|
+
const [pending, setPending] = useState(false);
|
|
34
|
+
const [error, setError] = useState(null);
|
|
35
|
+
const [deleted, setDeleted] = useState(false);
|
|
36
|
+
if (deleted) {
|
|
37
|
+
return /*#__PURE__*/_jsx(OxyAuthScreen, {
|
|
38
|
+
children: /*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
39
|
+
title: t('deleteAccount.passkey.done'),
|
|
40
|
+
description: t('deleteAccount.passkey.closeWindow')
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const username = user?.username ?? '';
|
|
45
|
+
if (user?.publicKey) {
|
|
46
|
+
return /*#__PURE__*/_jsx(OxyAuthScreen, {
|
|
47
|
+
children: /*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
48
|
+
title: t('deleteAccount.handoff.commonsTitle'),
|
|
49
|
+
description: t('deleteAccount.passkey.commons')
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// The ceremony opens the browser's passkey prompt, so it starts from the press.
|
|
55
|
+
const remove = () => {
|
|
56
|
+
if (pending) return;
|
|
57
|
+
if (confirmText.trim() !== username) {
|
|
58
|
+
setError(t('deleteAccount.confirmLabel', {
|
|
59
|
+
username
|
|
60
|
+
}));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setError(null);
|
|
64
|
+
setPending(true);
|
|
65
|
+
(async () => {
|
|
66
|
+
if (!isPasskeySupported()) throw new Error(PASSKEY_UNSUPPORTED_MESSAGE);
|
|
67
|
+
const options = await oxyServices.getAccountDeletionOptions();
|
|
68
|
+
const assertion = await runAuthenticationCeremony(options);
|
|
69
|
+
await oxyServices.deleteAccountWithPasskey(confirmText.trim(), assertion);
|
|
70
|
+
await logout().catch(() => undefined);
|
|
71
|
+
setDeleted(true);
|
|
72
|
+
onDeleted?.();
|
|
73
|
+
})().catch(reason => setError(describeAccountFlowError(reason, t))).finally(() => setPending(false));
|
|
74
|
+
};
|
|
75
|
+
return /*#__PURE__*/_jsxs(OxyAuthScreen, {
|
|
76
|
+
children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
77
|
+
title: t('deleteAccount.title'),
|
|
78
|
+
description: t('deleteAccount.passkey.subtitle', {
|
|
79
|
+
username
|
|
80
|
+
})
|
|
81
|
+
}), /*#__PURE__*/_jsx(AccountFlowNote, {
|
|
82
|
+
children: t('deleteAccount.warning')
|
|
83
|
+
}), /*#__PURE__*/_jsx(AccountFlowField, {
|
|
84
|
+
label: t('deleteAccount.confirmLabel', {
|
|
85
|
+
username
|
|
86
|
+
}),
|
|
87
|
+
value: confirmText,
|
|
88
|
+
onChange: value => {
|
|
89
|
+
setConfirmText(value);
|
|
90
|
+
if (error) setError(null);
|
|
91
|
+
},
|
|
92
|
+
onSubmit: remove,
|
|
93
|
+
error: null,
|
|
94
|
+
disabled: pending,
|
|
95
|
+
placeholder: username,
|
|
96
|
+
autoComplete: "off",
|
|
97
|
+
testID: "delete-account-confirm"
|
|
98
|
+
}), error ? /*#__PURE__*/_jsx(AccountFlowErrorLine, {
|
|
99
|
+
message: error
|
|
100
|
+
}) : null, /*#__PURE__*/_jsx(AccountFlowAction, {
|
|
101
|
+
label: t('deleteAccount.passkey.action'),
|
|
102
|
+
onPress: remove,
|
|
103
|
+
pending: pending,
|
|
104
|
+
disabled: confirmText.trim() !== username,
|
|
105
|
+
testID: "delete-account-passkey"
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=OxyDeleteAccountPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","useOxy","useI18n","isPasskeySupported","runAuthenticationCeremony","PASSKEY_UNSUPPORTED_MESSAGE","OxyAuthScreen","OxyAuthScreenHeader","AccountFlowAction","AccountFlowErrorLine","AccountFlowField","AccountFlowNote","describeAccountFlowError","jsx","_jsx","jsxs","_jsxs","OxyDeleteAccountPanel","onDeleted","t","user","oxyServices","logout","confirmText","setConfirmText","pending","setPending","error","setError","deleted","setDeleted","children","title","description","username","publicKey","remove","trim","Error","options","getAccountDeletionOptions","assertion","deleteAccountWithPasskey","catch","undefined","reason","finally","label","value","onChange","onSubmit","disabled","placeholder","autoComplete","testID","message","onPress"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/OxyDeleteAccountPanel.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,MAAM,QAAQ,6BAA0B;AACjD,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,kBAAkB,EAAEC,yBAAyB,QAAQ,iCAAiC;AAC/F,SAASC,2BAA2B,QAAQ,8BAA2B;AACvE,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,oBAAiB;AACpE,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,EACfC,wBAAwB,QACnB,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAO5B,OAAO,MAAMC,qBAA2D,GAAGA,CAAC;EAAEC;AAAU,CAAC,KAAK;EAC5F,MAAM;IAAEC;EAAE,CAAC,GAAGjB,OAAO,CAAC,CAAC;EACvB,MAAM;IAAEkB,IAAI;IAAEC,WAAW;IAAEC;EAAO,CAAC,GAAGrB,MAAM,CAAC,CAAC;EAC9C,MAAM,CAACsB,WAAW,EAAEC,cAAc,CAAC,GAAGxB,QAAQ,CAAC,EAAE,CAAC;EAClD,MAAM,CAACyB,OAAO,EAAEC,UAAU,CAAC,GAAG1B,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAAC2B,KAAK,EAAEC,QAAQ,CAAC,GAAG5B,QAAQ,CAAgB,IAAI,CAAC;EACvD,MAAM,CAAC6B,OAAO,EAAEC,UAAU,CAAC,GAAG9B,QAAQ,CAAC,KAAK,CAAC;EAE7C,IAAI6B,OAAO,EAAE;IACX,oBACEf,IAAA,CAACR,aAAa;MAAAyB,QA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