@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,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The pieces auth.oxy.so's account pages share (ADR 0029 D3): creating a
|
|
5
|
+
* passkey account, recovering one, deleting one. Each is a page of the IdP
|
|
6
|
+
* built from the same sign-in shell as `OxySignInPanel`, so they read as one
|
|
7
|
+
* product; the passkey belongs to auth.oxy.so, so none of them runs anywhere
|
|
8
|
+
* else.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useState } from 'react';
|
|
12
|
+
import { StyleSheet, View } from 'react-native';
|
|
13
|
+
import { Button } from '@oxy.so/bloom/button';
|
|
14
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
15
|
+
import { TextField, TextFieldHint, TextFieldInput, TextFieldLabel } from '@oxy.so/bloom/text-field';
|
|
16
|
+
import { Text } from '@oxy.so/bloom/typography';
|
|
17
|
+
import { EMAIL_CODE_LENGTH, EMAIL_VERIFICATION_ERROR_CODES } from '@oxy.so/contracts';
|
|
18
|
+
import { useOxy } from "../../context/OxyContext.js";
|
|
19
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
20
|
+
import { SubtleLink } from "../authChooser/primitives.js";
|
|
21
|
+
import { OxyAuthScreen, OxyAuthScreenHeader } from "./OxyAuthScreen.js";
|
|
22
|
+
import { describePasskeyError, isRateLimited } from "./passkeyError.js";
|
|
23
|
+
|
|
24
|
+
/** The API error code a thrown SDK error carries (`error.code`), if any. */
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
function errorCode(error) {
|
|
27
|
+
const code = error?.code;
|
|
28
|
+
return typeof code === 'string' ? code : undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A failure of an account page, in the person's language. */
|
|
32
|
+
export function describeAccountFlowError(error, t) {
|
|
33
|
+
switch (errorCode(error)) {
|
|
34
|
+
case EMAIL_VERIFICATION_ERROR_CODES.codeInvalid:
|
|
35
|
+
return t('emailCode.errors.codeInvalid');
|
|
36
|
+
case EMAIL_VERIFICATION_ERROR_CODES.tooManyAttempts:
|
|
37
|
+
return t('emailCode.errors.tooManyAttempts');
|
|
38
|
+
case EMAIL_VERIFICATION_ERROR_CODES.ticketInvalid:
|
|
39
|
+
case EMAIL_VERIFICATION_ERROR_CODES.ticketRequired:
|
|
40
|
+
return t('emailCode.errors.expired');
|
|
41
|
+
case EMAIL_VERIFICATION_ERROR_CODES.unavailable:
|
|
42
|
+
return t('emailCode.errors.unavailable');
|
|
43
|
+
default:
|
|
44
|
+
if (isRateLimited(error)) return t('emailCode.errors.rateLimited');
|
|
45
|
+
return describePasskeyError(error, t);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Whether the confirmation this flow holds is gone and it must start again. */
|
|
50
|
+
export function isTicketExpired(error) {
|
|
51
|
+
const code = errorCode(error);
|
|
52
|
+
return code === EMAIL_VERIFICATION_ERROR_CODES.ticketInvalid || code === EMAIL_VERIFICATION_ERROR_CODES.ticketRequired;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** One labelled input, the way the sign-in screen draws its username. */
|
|
56
|
+
export const AccountFlowField = ({
|
|
57
|
+
label,
|
|
58
|
+
value,
|
|
59
|
+
onChange,
|
|
60
|
+
onSubmit,
|
|
61
|
+
error,
|
|
62
|
+
disabled,
|
|
63
|
+
placeholder,
|
|
64
|
+
autoComplete,
|
|
65
|
+
keyboardType,
|
|
66
|
+
maxLength,
|
|
67
|
+
testID
|
|
68
|
+
}) => /*#__PURE__*/_jsxs(View, {
|
|
69
|
+
style: styles.field,
|
|
70
|
+
children: [/*#__PURE__*/_jsx(TextFieldLabel, {
|
|
71
|
+
children: label
|
|
72
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
73
|
+
invalid: error !== null,
|
|
74
|
+
disabled: disabled,
|
|
75
|
+
radius: 999,
|
|
76
|
+
style: styles.input,
|
|
77
|
+
children: /*#__PURE__*/_jsx(TextFieldInput, {
|
|
78
|
+
testID: testID,
|
|
79
|
+
label: label,
|
|
80
|
+
value: value,
|
|
81
|
+
onValueChange: onChange,
|
|
82
|
+
placeholder: placeholder,
|
|
83
|
+
autoComplete: autoComplete,
|
|
84
|
+
keyboardType: keyboardType,
|
|
85
|
+
maxLength: maxLength,
|
|
86
|
+
autoCapitalize: "none",
|
|
87
|
+
autoCorrect: false,
|
|
88
|
+
autoFocus: true,
|
|
89
|
+
returnKeyType: "go",
|
|
90
|
+
onSubmitEditing: onSubmit,
|
|
91
|
+
"aria-required": true
|
|
92
|
+
})
|
|
93
|
+
}), error ? /*#__PURE__*/_jsx(TextFieldHint, {
|
|
94
|
+
invalid: true,
|
|
95
|
+
children: error
|
|
96
|
+
}) : null]
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/** The screen's one primary action. */
|
|
100
|
+
export const AccountFlowAction = ({
|
|
101
|
+
label,
|
|
102
|
+
onPress,
|
|
103
|
+
pending,
|
|
104
|
+
disabled,
|
|
105
|
+
testID
|
|
106
|
+
}) => /*#__PURE__*/_jsx(Button, {
|
|
107
|
+
appearance: "solid",
|
|
108
|
+
tone: "action",
|
|
109
|
+
size: "lg",
|
|
110
|
+
fullWidth: true,
|
|
111
|
+
loading: pending,
|
|
112
|
+
disabled: pending || disabled,
|
|
113
|
+
onPress: onPress,
|
|
114
|
+
testID: testID,
|
|
115
|
+
children: label
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/** A line of body copy under the header. */
|
|
119
|
+
export const AccountFlowNote = ({
|
|
120
|
+
children
|
|
121
|
+
}) => {
|
|
122
|
+
const theme = useTheme();
|
|
123
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
124
|
+
style: [styles.note, {
|
|
125
|
+
color: theme.colors.textSecondary
|
|
126
|
+
}],
|
|
127
|
+
children: children
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/** Why a step failed, where it happened. */
|
|
132
|
+
export const AccountFlowErrorLine = ({
|
|
133
|
+
message
|
|
134
|
+
}) => {
|
|
135
|
+
const theme = useTheme();
|
|
136
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
137
|
+
accessibilityRole: "alert",
|
|
138
|
+
style: [styles.note, {
|
|
139
|
+
color: theme.colors.error
|
|
140
|
+
}],
|
|
141
|
+
children: message
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
/** "Check your email": the 6-digit code a verification sent. */
|
|
145
|
+
export const EmailCodeStep = ({
|
|
146
|
+
description,
|
|
147
|
+
verificationId,
|
|
148
|
+
onConfirmed,
|
|
149
|
+
onResend,
|
|
150
|
+
back
|
|
151
|
+
}) => {
|
|
152
|
+
const theme = useTheme();
|
|
153
|
+
const {
|
|
154
|
+
t
|
|
155
|
+
} = useI18n();
|
|
156
|
+
const {
|
|
157
|
+
oxyServices
|
|
158
|
+
} = useOxy();
|
|
159
|
+
const [code, setCode] = useState('');
|
|
160
|
+
const [pending, setPending] = useState(false);
|
|
161
|
+
const [error, setError] = useState(null);
|
|
162
|
+
const [notice, setNotice] = useState(null);
|
|
163
|
+
const confirm = () => {
|
|
164
|
+
const digits = code.replace(/\D/g, '');
|
|
165
|
+
if (digits.length !== EMAIL_CODE_LENGTH || pending) {
|
|
166
|
+
setError(t('emailCode.errors.codeInvalid'));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
setError(null);
|
|
170
|
+
setPending(true);
|
|
171
|
+
oxyServices.confirmEmailVerification(verificationId, digits).then(onConfirmed).catch(reason => setError(describeAccountFlowError(reason, t))).finally(() => setPending(false));
|
|
172
|
+
};
|
|
173
|
+
const resend = () => {
|
|
174
|
+
setError(null);
|
|
175
|
+
setNotice(null);
|
|
176
|
+
setCode('');
|
|
177
|
+
onResend().then(() => setNotice(t('emailCode.resent'))).catch(reason => setError(describeAccountFlowError(reason, t)));
|
|
178
|
+
};
|
|
179
|
+
return /*#__PURE__*/_jsxs(OxyAuthScreen, {
|
|
180
|
+
children: [/*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
181
|
+
title: t('emailCode.title'),
|
|
182
|
+
description: description
|
|
183
|
+
}), /*#__PURE__*/_jsx(AccountFlowField, {
|
|
184
|
+
label: t('emailCode.label'),
|
|
185
|
+
value: code,
|
|
186
|
+
onChange: value => {
|
|
187
|
+
setCode(value);
|
|
188
|
+
if (error) setError(null);
|
|
189
|
+
},
|
|
190
|
+
onSubmit: confirm,
|
|
191
|
+
error: error,
|
|
192
|
+
disabled: pending,
|
|
193
|
+
placeholder: "000000",
|
|
194
|
+
autoComplete: "one-time-code",
|
|
195
|
+
keyboardType: "number-pad",
|
|
196
|
+
maxLength: EMAIL_CODE_LENGTH,
|
|
197
|
+
testID: "email-code"
|
|
198
|
+
}), notice ? /*#__PURE__*/_jsx(Text, {
|
|
199
|
+
style: [styles.note, {
|
|
200
|
+
color: theme.colors.textSecondary
|
|
201
|
+
}],
|
|
202
|
+
children: notice
|
|
203
|
+
}) : null, /*#__PURE__*/_jsx(AccountFlowAction, {
|
|
204
|
+
label: t('signin.actions.continue'),
|
|
205
|
+
onPress: confirm,
|
|
206
|
+
pending: pending,
|
|
207
|
+
testID: "email-code-continue"
|
|
208
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
209
|
+
label: t('emailCode.resend'),
|
|
210
|
+
theme: theme,
|
|
211
|
+
onPress: resend,
|
|
212
|
+
disabled: pending,
|
|
213
|
+
testID: "email-code-resend"
|
|
214
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
215
|
+
label: back.label,
|
|
216
|
+
theme: theme,
|
|
217
|
+
onPress: back.onPress,
|
|
218
|
+
disabled: pending,
|
|
219
|
+
testID: "email-code-back"
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
const styles = StyleSheet.create({
|
|
224
|
+
field: {
|
|
225
|
+
gap: 6
|
|
226
|
+
},
|
|
227
|
+
input: {
|
|
228
|
+
height: 40
|
|
229
|
+
},
|
|
230
|
+
note: {
|
|
231
|
+
fontSize: 16,
|
|
232
|
+
lineHeight: 24
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=accountFlowParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","StyleSheet","View","Button","useTheme","TextField","TextFieldHint","TextFieldInput","TextFieldLabel","Text","EMAIL_CODE_LENGTH","EMAIL_VERIFICATION_ERROR_CODES","useOxy","useI18n","SubtleLink","OxyAuthScreen","OxyAuthScreenHeader","describePasskeyError","isRateLimited","jsx","_jsx","jsxs","_jsxs","errorCode","error","code","undefined","describeAccountFlowError","t","codeInvalid","tooManyAttempts","ticketInvalid","ticketRequired","unavailable","isTicketExpired","AccountFlowField","label","value","onChange","onSubmit","disabled","placeholder","autoComplete","keyboardType","maxLength","testID","style","styles","field","children","invalid","radius","input","onValueChange","autoCapitalize","autoCorrect","autoFocus","returnKeyType","onSubmitEditing","AccountFlowAction","onPress","pending","appearance","tone","size","fullWidth","loading","AccountFlowNote","theme","note","color","colors","textSecondary","AccountFlowErrorLine","message","accessibilityRole","EmailCodeStep","description","verificationId","onConfirmed","onResend","back","oxyServices","setCode","setPending","setError","notice","setNotice","confirm","digits","replace","length","confirmEmailVerification","then","catch","reason","finally","resend","title","create","gap","height","fontSize","lineHeight"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/accountFlowParts.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,SAAS,E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EqB,OAAQ;MAAChB,MAAM,EAAC;IAAmB,CAAE,CAAC,eACzHzB,IAAA,CAACN,UAAU;MAACsB,KAAK,EAAE6C,IAAI,CAAC7C,KAAM;MAACgC,KAAK,EAAEA,KAAM;MAACR,OAAO,EAAEqB,IAAI,CAACrB,OAAQ;MAACpB,QAAQ,EAAEqB,OAAQ;MAAChB,MAAM,EAAC;IAAiB,CAAE,CAAC;EAAA,CACrG,CAAC;AAEpB,CAAC;AAED,MAAME,MAAM,GAAG9C,UAAU,CAACkG,MAAM,CAAC;EAC/BnD,KAAK,EAAE;IACLoD,GAAG,EAAE;EACP,CAAC;EACDhD,KAAK,EAAE;IACLiD,MAAM,EAAE;EACV,CAAC;EACDhC,IAAI,EAAE;IACJiC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The photos the sign-in split card's carousel turns through. Shipped with the
|
|
5
|
+
* SDK and imported like its icon fonts, so every host serves them from its own
|
|
6
|
+
* origin — nothing to allow in anyone's CSP.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import slide1 from '../../../assets/signIn/slide-1.jpg';
|
|
10
|
+
import slide2 from '../../../assets/signIn/slide-2.jpg';
|
|
11
|
+
import slide3 from '../../../assets/signIn/slide-3.jpg';
|
|
12
|
+
import slide4 from '../../../assets/signIn/slide-4.jpg';
|
|
13
|
+
export const SIGN_IN_SLIDES = [slide1, slide2, slide3, slide4].map(source => ({
|
|
14
|
+
source
|
|
15
|
+
}));
|
|
16
|
+
//# sourceMappingURL=artwork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["slide1","slide2","slide3","slide4","SIGN_IN_SLIDES","map","source"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/artwork.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,MAAM,MAAM,oCAAoC;AACvD,OAAOC,MAAM,MAAM,oCAAoC;AACvD,OAAOC,MAAM,MAAM,oCAAoC;AACvD,OAAOC,MAAM,MAAM,oCAAoC;AAEvD,OAAO,MAAMC,cAAgC,GAAG,CAACJ,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAACE,GAAG,CAAEC,MAAM,KAAM;EAAEA;AAAO,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The message for a failed passkey sign-in, and whether it was rate-limited.
|
|
5
|
+
*
|
|
6
|
+
* A dismissed or timed-out browser prompt rejects with a `NotAllowedError` /
|
|
7
|
+
* `AbortError` DOMException, often re-wrapped by `@simplewebauthn/browser` as a
|
|
8
|
+
* `WebAuthnError` whose `cause` is the original — so the cancellation shape is
|
|
9
|
+
* looked for along the cause chain, and reported calmly instead of as the raw
|
|
10
|
+
* "The operation either timed out or was not allowed…".
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** How long the surface waits after a 429 before it lets the person retry. */
|
|
14
|
+
export const RATE_LIMIT_SECONDS = 60;
|
|
15
|
+
function isCancellation(error) {
|
|
16
|
+
let current = error;
|
|
17
|
+
for (let depth = 0; depth < 5 && current instanceof Error; depth += 1) {
|
|
18
|
+
if (current.name === 'NotAllowedError' || current.name === 'AbortError') return true;
|
|
19
|
+
// `@simplewebauthn/browser`'s stable code for an aborted ceremony.
|
|
20
|
+
if (current.code === 'ERROR_CEREMONY_ABORTED') return true;
|
|
21
|
+
current = current.cause;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** An HTTP status off a thrown SDK error (ApiError- or axios-shaped). */
|
|
27
|
+
function errorStatus(error) {
|
|
28
|
+
return error?.status ?? error?.response?.status;
|
|
29
|
+
}
|
|
30
|
+
export function isRateLimited(error) {
|
|
31
|
+
return errorStatus(error) === 429;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The inline message for a passkey ceremony that did not sign anyone in. */
|
|
35
|
+
export function describePasskeyError(error, t) {
|
|
36
|
+
if (isCancellation(error)) return t('signin.errors.passkeyCancelled');
|
|
37
|
+
if (error instanceof Error && error.message.trim().length > 0) return error.message;
|
|
38
|
+
return t('signin.errors.passkeyFailed');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=passkeyError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RATE_LIMIT_SECONDS","isCancellation","error","current","depth","Error","name","code","cause","errorStatus","status","response","isRateLimited","describePasskeyError","t","message","trim","length"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/passkeyError.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA,OAAO,MAAMA,kBAAkB,GAAG,EAAE;AAEpC,SAASC,cAAcA,CAACC,KAAc,EAAW;EAC/C,IAAIC,OAAgB,GAAGD,KAAK;EAC5B,KAAK,IAAIE,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAG,CAAC,IAAID,OAAO,YAAYE,KAAK,EAAED,KAAK,IAAI,CAAC,EAAE;IACrE,IAAID,OAAO,CAACG,IAAI,KAAK,iBAAiB,IAAIH,OAAO,CAACG,IAAI,KAAK,YAAY,EAAE,OAAO,IAAI;IACpF;IACA,IAAKH,OAAO,CAAwBI,IAAI,KAAK,wBAAwB,EAAE,OAAO,IAAI;IAClFJ,OAAO,GAAIA,OAAO,CAAyBK,KAAK;EAClD;EACA,OAAO,KAAK;AACd;;AAEA;AACA,SAASC,WAAWA,CAACP,KAAc,EAAsB;EACvD,OACGA,KAAK,EAAsCQ,MAAM,IACjDR,KAAK,EAAqDS,QAAQ,EAAED,MAAM;AAE/E;AAEA,OAAO,SAASE,aAAaA,CAACV,KAAc,EAAW;EACrD,OAAOO,WAAW,CAACP,KAAK,CAAC,KAAK,GAAG;AACnC;;AAEA;AACA,OAAO,SAASW,oBAAoBA,CAACX,KAAc,EAAEY,CAAY,EAAU;EACzE,IAAIb,cAAc,CAACC,KAAK,CAAC,EAAE,OAAOY,CAAC,CAAC,gCAAgC,CAAC;EACrE,IAAIZ,KAAK,YAAYG,KAAK,IAAIH,KAAK,CAACa,OAAO,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE,OAAOf,KAAK,CAACa,OAAO;EACnF,OAAOD,CAAC,CAAC,6BAA6B,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Which sign-in methods a surface offers, from where it runs.
|
|
5
|
+
*
|
|
6
|
+
* One screen everywhere; only the transport behind each block changes:
|
|
7
|
+
*
|
|
8
|
+
* - auth.oxy.so (`page`) is where the web signs in: the embedded Commons QR
|
|
9
|
+
* (the split card's right column from `md`, "Continue with Oxy" below it),
|
|
10
|
+
* the username with its Continue, and the passkey — asserted right here,
|
|
11
|
+
* on the one origin every Oxy passkey belongs to;
|
|
12
|
+
* - an app's account dialog on the web (`dialog`) opens that screen in a
|
|
13
|
+
* window over the app ("Continue with Oxy"), like "Sign in with Google":
|
|
14
|
+
* the browser's session lives on auth.oxy.so, so every Oxy app shares it;
|
|
15
|
+
* - native signs in with Commons: "Continue with Oxy", or "Get Commons" on a
|
|
16
|
+
* device that has no Commons to continue with.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* `qr` — auth.oxy.so: the embedded QR from `md`, "Continue with Oxy" below.
|
|
21
|
+
* `window` — an app on the web: "Continue with Oxy" opens auth.oxy.so's window.
|
|
22
|
+
* `continue` — native "Continue with Oxy": Oxy picks the route (shared
|
|
23
|
+
* keychain, Commons on this device, a push, or the QR view).
|
|
24
|
+
* `get-commons` — native, and Commons is not installed here.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export function resolveSignInMethods(facts) {
|
|
28
|
+
if (facts.web) {
|
|
29
|
+
return facts.host === 'page' ? {
|
|
30
|
+
commons: 'qr',
|
|
31
|
+
passkey: true
|
|
32
|
+
} : {
|
|
33
|
+
commons: 'window',
|
|
34
|
+
passkey: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
commons: facts.commonsAvailability === 'unavailable' ? 'get-commons' : 'continue',
|
|
39
|
+
passkey: false
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=signInMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveSignInMethods","facts","web","host","commons","passkey","commonsAvailability"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/signInMethods.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,OAAO,SAASA,oBAAoBA,CAACC,KAAyB,EAAiB;EAC7E,IAAIA,KAAK,CAACC,GAAG,EAAE;IACb,OAAOD,KAAK,CAACE,IAAI,KAAK,MAAM,GAAG;MAAEC,OAAO,EAAE,IAAI;MAAEC,OAAO,EAAE;IAAK,CAAC,GAAG;MAAED,OAAO,EAAE,QAAQ;MAAEC,OAAO,EAAE;IAAM,CAAC;EACzG;EACA,OAAO;IACLD,OAAO,EAAEH,KAAK,CAACK,mBAAmB,KAAK,aAAa,GAAG,aAAa,GAAG,UAAU;IACjFD,OAAO,EAAE;EACX,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { Linking, Platform } from 'react-native';
|
|
5
|
-
import { OxyServices, oxyClient } from '@oxy.so/core';
|
|
5
|
+
import { DeviceManager, OxyServices, oxyClient } from '@oxy.so/core';
|
|
6
6
|
import { KeyManager, establishIdentitySession, installAuthRefreshHandler, startTokenRefreshScheduler, createAccountDialogController, logger as loggerUtil } from '@oxy.so/core';
|
|
7
7
|
import { registerAccountDialogControls, notifyAccountDialogVisibility } from "../navigation/accountDialogManager.js";
|
|
8
8
|
import { redirectToAuthorize } from "../components/oauthNavigation.js";
|
|
9
|
-
import { openPasskeyHubPopup } from "../components/passkeyHubPopup.js";
|
|
10
9
|
import { startWebOAuthSignIn } from "../oauth/browserAuthTransport.js";
|
|
11
10
|
import { requestOAuthConsent } from "../oauth/explicitOAuthConsent.js";
|
|
12
11
|
import { isWebBrowser } from "../utils/isWebBrowser.js";
|
|
@@ -66,7 +65,6 @@ export const OxyRuntimeProvider = ({
|
|
|
66
65
|
sessionMode = 'account',
|
|
67
66
|
webAuthMode = 'popup',
|
|
68
67
|
backgroundSession = false,
|
|
69
|
-
deviceCredentialStorage = 'persistent',
|
|
70
68
|
platformStorage,
|
|
71
69
|
onAuthStateChange,
|
|
72
70
|
onError
|
|
@@ -91,16 +89,10 @@ export const OxyRuntimeProvider = ({
|
|
|
91
89
|
|
|
92
90
|
// The device-first persisted auth-state store (per-origin device credential on
|
|
93
91
|
// web; SecureStore session blob on native). Built ONCE per provider mount.
|
|
94
|
-
//
|
|
95
|
-
// `deviceCredentialStorage` is mount-time configuration for the same reason
|
|
96
|
-
// `sessionMode` is: it decides where the durable credential lives, and letting
|
|
97
|
-
// it change mid-flight would mean a session that started ephemeral could begin
|
|
98
|
-
// writing one.
|
|
99
92
|
const authStoreRef = useRef(null);
|
|
100
93
|
if (!authStoreRef.current) {
|
|
101
94
|
authStoreRef.current = createPlatformAuthStateStore({
|
|
102
|
-
sessionMode
|
|
103
|
-
storage: deviceCredentialStorage
|
|
95
|
+
sessionMode
|
|
104
96
|
});
|
|
105
97
|
}
|
|
106
98
|
const authStore = authStoreRef.current;
|
|
@@ -676,6 +668,16 @@ export const OxyRuntimeProvider = ({
|
|
|
676
668
|
})
|
|
677
669
|
}, options), [webAuthMode, oxyServices, clientId, authorizeBaseUrl, isIdentityBound, user?.id]);
|
|
678
670
|
|
|
671
|
+
// On the web an Oxy app signs in and creates accounts in auth.oxy.so's
|
|
672
|
+
// window over the app, like "Sign in with Google": the passkey belongs to
|
|
673
|
+
// that origin, and the browser's session lives there, shared by every Oxy
|
|
674
|
+
// app. A blocked window falls back to the same page in this tab.
|
|
675
|
+
const continueOnAuth = useCallback(screen => startWebOAuthSignInForContext({
|
|
676
|
+
redirectUri: authRedirectUri ?? globalThis.location?.origin ?? '',
|
|
677
|
+
transport: 'popup',
|
|
678
|
+
screen
|
|
679
|
+
}), [startWebOAuthSignInForContext, authRedirectUri]);
|
|
680
|
+
|
|
679
681
|
// ── Unified account dialog ─────────────────────────────────────────────────
|
|
680
682
|
// The single account-chooser + sign-in surface. Built ONCE per provider mount
|
|
681
683
|
// and bound to the live `oxyServices` + `sessionClient` + this provider's
|
|
@@ -745,11 +747,6 @@ export const OxyRuntimeProvider = ({
|
|
|
745
747
|
// controller short-circuits, so `redirectToAuthorize` never runs for the
|
|
746
748
|
// `oxycommons://` payload.
|
|
747
749
|
canOpenApp: isWebBrowser() ? undefined : url => Linking.canOpenURL(url),
|
|
748
|
-
// Web-only: lets `startPasskeyHubSignIn` open the auth.oxy.so passkey hub
|
|
749
|
-
// popup (b2) for a non-Oxy origin. `undefined` on native — there is no
|
|
750
|
-
// popup concept there, and off-origin passkey sign-in isn't reachable
|
|
751
|
-
// (Commons owns the native flow).
|
|
752
|
-
openPopup: isWebBrowser() ? openPasskeyHubPopup : undefined,
|
|
753
750
|
// Which surface a sign-in starts from — a FACT only this consumer can
|
|
754
751
|
// supply (headless core never touches a platform global). It decides
|
|
755
752
|
// whether automatic delivery may take the same-device Commons deep link;
|
|
@@ -870,7 +867,9 @@ export const OxyRuntimeProvider = ({
|
|
|
870
867
|
username: opts?.username,
|
|
871
868
|
deviceId: persisted?.deviceId,
|
|
872
869
|
deviceName: opts?.deviceName,
|
|
873
|
-
|
|
870
|
+
// The same shape every other sign-in path sends; the server only reads it
|
|
871
|
+
// to place a device that has no persisted id yet.
|
|
872
|
+
deviceFingerprint: opts?.deviceFingerprint ?? JSON.stringify(DeviceManager.getDeviceFingerprint())
|
|
874
873
|
});
|
|
875
874
|
}, [oxyServices, authStore, commitSession]);
|
|
876
875
|
|
|
@@ -1151,6 +1150,7 @@ export const OxyRuntimeProvider = ({
|
|
|
1151
1150
|
revokeSuspiciousSignIn,
|
|
1152
1151
|
handleWebSession,
|
|
1153
1152
|
startWebOAuthSignIn: startWebOAuthSignInForContext,
|
|
1153
|
+
continueOnAuth,
|
|
1154
1154
|
requestOAuthConsent: requestOAuthConsentForContext,
|
|
1155
1155
|
logout,
|
|
1156
1156
|
logoutAll,
|
|
@@ -1178,7 +1178,7 @@ export const OxyRuntimeProvider = ({
|
|
|
1178
1178
|
switchToAccount,
|
|
1179
1179
|
refreshAccounts,
|
|
1180
1180
|
createAccount: createAccountFn
|
|
1181
|
-
}), [user, sessions, activeSessionId, isAuthenticated, isLoading, tokenReady, hasAccessToken, canUsePrivateApi, isPrivateApiPending, authResolved, snapshot.storageReady, isIdentityBound, webAuthMode, error, currentLanguage, currentLanguages, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, hasIdentity, getPublicKey, signIn, signInWithPasskey, addPasskey, removePasskey, revokeSuspiciousSignIn, handleWebSession, startWebOAuthSignInForContext, requestOAuthConsentForContext, logout, logoutAll, switchSessionForContext, refreshSessionsForContext, setLanguage, getDeviceSessions, logoutAllDeviceSessions, updateDeviceName, clearSessionState, clearAllAccountData, storageKeyPrefix, clientId, oxyServices, sessionClient, showBottomSheetForContext, openAvatarPicker, accountDialogController, accountDialogOpen, openAccountDialog, closeAccountDialog, accounts, switchToAccount, refreshAccounts, createAccountFn]);
|
|
1181
|
+
}), [user, sessions, activeSessionId, isAuthenticated, isLoading, tokenReady, hasAccessToken, canUsePrivateApi, isPrivateApiPending, authResolved, snapshot.storageReady, isIdentityBound, webAuthMode, error, currentLanguage, currentLanguages, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, hasIdentity, getPublicKey, signIn, signInWithPasskey, addPasskey, removePasskey, revokeSuspiciousSignIn, handleWebSession, startWebOAuthSignInForContext, continueOnAuth, requestOAuthConsentForContext, logout, logoutAll, switchSessionForContext, refreshSessionsForContext, setLanguage, getDeviceSessions, logoutAllDeviceSessions, updateDeviceName, clearSessionState, clearAllAccountData, storageKeyPrefix, clientId, oxyServices, sessionClient, showBottomSheetForContext, openAvatarPicker, accountDialogController, accountDialogOpen, openAccountDialog, closeAccountDialog, accounts, switchToAccount, refreshAccounts, createAccountFn]);
|
|
1182
1182
|
const authActionsValue = useMemo(() => ({
|
|
1183
1183
|
signIn,
|
|
1184
1184
|
logout,
|