@oxy.so/services 4.0.7 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/commonjs/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 +45 -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 -44
- 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 +29 -8
- 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/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/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/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/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/ManageAccountScreen.js +2 -3
- 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 +1 -1
- 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 +7 -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 -45
- 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 +21 -2
- 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/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/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/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/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/ManageAccountScreen.js +3 -4
- 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 +2 -2
- 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 +8 -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 +3 -3
- 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/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/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 +8 -9
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.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/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/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 +8 -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 +3 -3
- 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/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/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 +8 -9
- package/lib/typescript/module/ui/context/oxyContextTypes.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/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/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 +16 -7
- package/src/ui/components/OxyAccountDialogScreen.tsx +11 -72
- package/src/ui/components/OxyAuthChooser.tsx +37 -53
- package/src/ui/components/OxyProvider.tsx +0 -2
- package/src/ui/components/ProfileButton.tsx +1 -4
- package/src/ui/components/authChooser/AccountsMenuView.tsx +28 -1
- 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 +3 -3
- 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/OxySignInPanel.tsx +392 -0
- package/src/ui/components/signIn/OxySignUpPanel.tsx +86 -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 +21 -18
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
- package/src/ui/context/commitSessionFlow.ts +0 -61
- package/src/ui/context/oxyContextTypes.ts +9 -9
- 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/ManageAccountScreen.tsx +3 -4
- 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 +2 -2
- 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
|
@@ -15,17 +15,16 @@
|
|
|
15
15
|
* responsibility each:
|
|
16
16
|
*
|
|
17
17
|
* - `accounts` → `AccountsMenuView` — the signed-in Oxy account menu.
|
|
18
|
-
* - `add` / `signin` → `
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* (a QR on an unknown desktop, "Check Commons on your phone" where Oxy could
|
|
22
|
-
* deliver) IS the primary route there, never something behind a second tap.
|
|
18
|
+
* - `add` / `signin` → `OxySignInPanel` — THE sign-in screen, the one
|
|
19
|
+
* auth.oxy.so renders too: the device's accounts, then "Continue with
|
|
20
|
+
* Oxy" (on the web, auth.oxy.so's window over the app).
|
|
23
21
|
* - `qr` → `SignInRequestView` — the ACTIVE REQUEST: the controller-bound
|
|
24
22
|
* wiring over the shared, presentational `OxySignInRequestSurface` (the same
|
|
25
23
|
* component the auth.oxy.so IdP mounts from its OAuth-bound request). It maps
|
|
26
24
|
* `snapshot.signIn` onto that surface's props; alternatives stay behind
|
|
27
25
|
* "Having trouble?" until the chosen route reports `routeFailed`.
|
|
28
|
-
* - `signup` → `
|
|
26
|
+
* - `signup` → `OxySignUpPanel` — account creation: auth.oxy.so's window on
|
|
27
|
+
* the web, Commons on native.
|
|
29
28
|
*
|
|
30
29
|
* Per-account color re-theming uses Bloom's `APP_COLOR_PRESETS` + `BloomColorScope`
|
|
31
30
|
* (same visual language auth.oxy.so uses). Base theming is `useTheme()` + a
|
|
@@ -39,7 +38,7 @@ import { Linking, Platform } from 'react-native';
|
|
|
39
38
|
import { toast } from '@oxy.so/bloom/toast';
|
|
40
39
|
import { surfaces } from '@oxy.so/bloom/surfaces';
|
|
41
40
|
import { useTheme } from '@oxy.so/bloom/theme';
|
|
42
|
-
import {
|
|
41
|
+
import { AUTH_WEB_ORIGIN, getNormalizedUserHandle, type OxyAuthScreen, type User } from '@oxy.so/core';
|
|
43
42
|
import { useQueryClient } from '@tanstack/react-query';
|
|
44
43
|
import { useOxy } from '../context/OxyContext';
|
|
45
44
|
import { useDeviceSwitcher } from '../hooks/useDeviceSwitcher';
|
|
@@ -52,9 +51,7 @@ import { isWebBrowser } from '../utils/isWebBrowser';
|
|
|
52
51
|
import { getCommonsAcquisitionUrl } from '../utils/commonsStoreLinks';
|
|
53
52
|
import { useAccountStorageUsage } from '../hooks/queries/useServicesQueries';
|
|
54
53
|
import AccountsMenuView from './authChooser/AccountsMenuView';
|
|
55
|
-
import SignInEntryView from './authChooser/SignInEntryView';
|
|
56
54
|
import SignInRequestView from './authChooser/SignInRequestView';
|
|
57
|
-
import SignUpView from './authChooser/SignUpView';
|
|
58
55
|
import { signInFailureMessage } from './authChooser/signInFailureMessage';
|
|
59
56
|
import {
|
|
60
57
|
resolveAccentHex,
|
|
@@ -66,9 +63,9 @@ import {
|
|
|
66
63
|
type SignInAlternatives,
|
|
67
64
|
} from './authChooser/types';
|
|
68
65
|
import { EMPTY_ACCOUNT_DIALOG_SNAPSHOT } from '../hooks/accountDialogSnapshot';
|
|
66
|
+
import { OxySignInPanel } from './signIn/OxySignInPanel';
|
|
67
|
+
import { OxySignUpPanel } from './signIn/OxySignUpPanel';
|
|
69
68
|
|
|
70
|
-
/** Commons' own identity-creation deep link (mirrors the `approve`/`attest`/`card` intents). */
|
|
71
|
-
const COMMONS_CREATE_IDENTITY_URL = 'oxycommons://create-identity';
|
|
72
69
|
/**
|
|
73
70
|
* "Accounts by Oxy" management app — the canonical home for account settings,
|
|
74
71
|
* data export, and storage management. The account-menu rows deep-link into it
|
|
@@ -90,12 +87,6 @@ const toastedFailureAttempt = new WeakMap<object, number>();
|
|
|
90
87
|
export interface OxyAuthChooserProps {
|
|
91
88
|
/** Called after a completed switch, sign-in, or sign-up. */
|
|
92
89
|
onComplete?: () => void;
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated No effect. The web sign-in entry no longer auto-starts a
|
|
95
|
-
* device-flow request: its primary action opens the identity origin
|
|
96
|
-
* (`id.oxy.so`) in a popup, which a browser only allows from a user gesture.
|
|
97
|
-
*/
|
|
98
|
-
autoStartSignIn?: boolean;
|
|
99
90
|
}
|
|
100
91
|
|
|
101
92
|
/**
|
|
@@ -111,6 +102,7 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
111
102
|
logout,
|
|
112
103
|
openAvatarPicker,
|
|
113
104
|
user,
|
|
105
|
+
continueOnAuth,
|
|
114
106
|
} = useOxy();
|
|
115
107
|
const theme = useTheme();
|
|
116
108
|
const { t } = useI18n();
|
|
@@ -120,13 +112,23 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
120
112
|
// so the two switchers cannot drift.
|
|
121
113
|
const { principals } = useDeviceSwitcher();
|
|
122
114
|
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
// no passkey path: Commons owns identity there ('none').
|
|
115
|
+
// On the web every sign-in and sign-up runs in auth.oxy.so's window over the
|
|
116
|
+
// app (`continueOnAuth`): the passkey belongs to that origin, and the
|
|
117
|
+
// browser's session lives there, shared by every Oxy app. Native has no
|
|
118
|
+
// passkey path: Commons owns identity there ('none').
|
|
128
119
|
const passkeyMode = useMemo<PasskeyMode>(() => (isWebBrowser() ? 'hub' : 'none'), []);
|
|
129
120
|
|
|
121
|
+
/** auth.oxy.so's window; this surface closes once it signs the app in. */
|
|
122
|
+
const openOnOxy = useCallback(
|
|
123
|
+
(screen: OxyAuthScreen) => {
|
|
124
|
+
void continueOnAuth(screen).then((result) => {
|
|
125
|
+
if (result.status === 'signed-in') onComplete?.();
|
|
126
|
+
else if (result.status === 'failed') toast.error(t('signin.errors.failed'));
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
[continueOnAuth, onComplete, t],
|
|
130
|
+
);
|
|
131
|
+
|
|
130
132
|
// Bind the headless controller. `getSnapshot` returns a stable reference
|
|
131
133
|
// between changes, so it is `useSyncExternalStore`-safe. Guard the no-provider
|
|
132
134
|
// loading state (`controller` is `null`) with an inert store.
|
|
@@ -140,7 +142,8 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
140
142
|
if (!controller) return () => undefined;
|
|
141
143
|
const maybeToastSignInError = () => {
|
|
142
144
|
const { signIn } = controller.getSnapshot();
|
|
143
|
-
|
|
145
|
+
// The embedded QR's failures are its own to handle (it renews itself).
|
|
146
|
+
if (signIn.phase !== 'error' || signIn.inline) return;
|
|
144
147
|
if (toastedFailureAttempt.get(controller) === signIn.attempt) return;
|
|
145
148
|
toastedFailureAttempt.set(controller, signIn.attempt);
|
|
146
149
|
const message = signInFailureMessage(signIn.failure, t);
|
|
@@ -363,18 +366,14 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
363
366
|
const alternatives = useMemo<SignInAlternatives>(
|
|
364
367
|
() => ({
|
|
365
368
|
passkeyAvailable: passkeyMode !== 'none',
|
|
366
|
-
//
|
|
367
|
-
onSignInWithPasskey: () =>
|
|
369
|
+
// auth.oxy.so asserts the passkey, in its window.
|
|
370
|
+
onSignInWithPasskey: () => openOnOxy('signin'),
|
|
368
371
|
onShowQr: () => void controller?.showQr(),
|
|
369
372
|
onGetCommons: () => openExternal(getCommonsAcquisitionUrl(Platform.OS)),
|
|
370
|
-
// Web: the
|
|
371
|
-
|
|
372
|
-
onCreateAccount: () => {
|
|
373
|
-
if (passkeyMode === 'hub') void controller?.startPasskeyHubSignIn();
|
|
374
|
-
else controller?.startSignup();
|
|
375
|
-
},
|
|
373
|
+
// Web: the account is made on auth.oxy.so. Native: Commons makes it.
|
|
374
|
+
onCreateAccount: () => (passkeyMode === 'hub' ? openOnOxy('signup') : controller?.startSignup()),
|
|
376
375
|
}),
|
|
377
|
-
[passkeyMode, controller, openExternal],
|
|
376
|
+
[passkeyMode, controller, openExternal, openOnOxy],
|
|
378
377
|
);
|
|
379
378
|
|
|
380
379
|
// Real storage usage for the account menu's "Oxy storage" block. Disabled
|
|
@@ -420,7 +419,7 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
420
419
|
onSignOut: () => {
|
|
421
420
|
void handleSignOut();
|
|
422
421
|
},
|
|
423
|
-
onOpenIdentity: passkeyMode === 'hub' ? () => openUrl(`${
|
|
422
|
+
onOpenIdentity: passkeyMode === 'hub' ? () => openUrl(`${AUTH_WEB_ORIGIN}/identity`) : undefined,
|
|
424
423
|
customItems: (consumerHooks?.menuItems ?? []).map((item) => ({
|
|
425
424
|
...item,
|
|
426
425
|
onPress: () => {
|
|
@@ -462,29 +461,14 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
|
|
|
462
461
|
}
|
|
463
462
|
|
|
464
463
|
if (view === 'signup') {
|
|
465
|
-
return (
|
|
466
|
-
<SignUpView
|
|
467
|
-
snapshot={snapshot}
|
|
468
|
-
theme={theme}
|
|
469
|
-
t={t}
|
|
470
|
-
passkeyMode={passkeyMode}
|
|
471
|
-
onOpenHub={() => void controller.startPasskeyHubSignIn()}
|
|
472
|
-
onCreateIdentityInCommons={() => openExternal(COMMONS_CREATE_IDENTITY_URL)}
|
|
473
|
-
onGetCommons={alternatives.onGetCommons}
|
|
474
|
-
onBackToSignIn={() => controller.setView('signin')}
|
|
475
|
-
/>
|
|
476
|
-
);
|
|
464
|
+
return <OxySignUpPanel onSignIn={() => controller.setView('signin')} onCreateOnWeb={() => openOnOxy('signup')} />;
|
|
477
465
|
}
|
|
478
466
|
|
|
479
467
|
return (
|
|
480
|
-
<
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
t={t}
|
|
485
|
-
handlers={handlers}
|
|
486
|
-
onContinueWithOxy={() => void controller.signInWithOxy()}
|
|
487
|
-
alternatives={alternatives}
|
|
468
|
+
<OxySignInPanel
|
|
469
|
+
host="dialog"
|
|
470
|
+
onSignedIn={() => onComplete?.()}
|
|
471
|
+
onCreateAccount={alternatives.onCreateAccount}
|
|
488
472
|
/>
|
|
489
473
|
);
|
|
490
474
|
};
|
|
@@ -90,7 +90,6 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
90
90
|
queryClient: providedQueryClient,
|
|
91
91
|
requireAuth = 'off',
|
|
92
92
|
backgroundSession = false,
|
|
93
|
-
deviceCredentialStorage = 'persistent',
|
|
94
93
|
language,
|
|
95
94
|
}) => {
|
|
96
95
|
|
|
@@ -240,7 +239,6 @@ const OxyProvider: FC<OxyProviderProps> = ({
|
|
|
240
239
|
sessionMode={sessionMode}
|
|
241
240
|
webAuthMode={webAuthMode}
|
|
242
241
|
backgroundSession={backgroundSession}
|
|
243
|
-
deviceCredentialStorage={deviceCredentialStorage}
|
|
244
242
|
platformStorage={platformStorage}
|
|
245
243
|
onAuthStateChange={onAuthStateChange as OxyRuntimeProviderProps['onAuthStateChange']}
|
|
246
244
|
>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type StyleProp,
|
|
5
|
-
type ViewStyle,
|
|
6
|
-
} from 'react-native';
|
|
3
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
7
4
|
import { View } from 'react-native-css/components';
|
|
8
5
|
import { RiLoginBoxLine } from '@oxy.so/bloom/icons/RiLoginBoxLine';
|
|
9
6
|
import { RiMoreLine } from '@oxy.so/bloom/icons/RiMoreLine';
|
|
@@ -51,7 +51,6 @@ import {
|
|
|
51
51
|
type SwitcherPrincipalRow,
|
|
52
52
|
} from '@oxy.so/core';
|
|
53
53
|
import AvatarCameraBadge from '../AvatarCameraBadge';
|
|
54
|
-
import { HoverPressable } from './primitives';
|
|
55
54
|
import { authChooserStyles as styles } from './styles';
|
|
56
55
|
import {
|
|
57
56
|
resolveAccentHex,
|
|
@@ -63,6 +62,34 @@ import {
|
|
|
63
62
|
type Translate,
|
|
64
63
|
} from './types';
|
|
65
64
|
|
|
65
|
+
type HoverPressableProps = Omit<React.ComponentProps<typeof Pressable>, 'className'> & {
|
|
66
|
+
baseClassName: string;
|
|
67
|
+
hoverClassName: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A `Pressable` that appends a hover-tint NativeWind token while pointer-hovered.
|
|
72
|
+
* The Metro web pipeline here does NOT emit NativeWind `hover:` variants, so hover
|
|
73
|
+
* is driven by RN's cross-platform `onHoverIn`/`onHoverOut` (they fire only on web
|
|
74
|
+
* via react-native-web; a no-op on native) toggling a plain background token —
|
|
75
|
+
* the tint stays a NativeWind class, only the trigger is JS.
|
|
76
|
+
*/
|
|
77
|
+
const HoverPressable: React.FC<HoverPressableProps> = ({
|
|
78
|
+
baseClassName,
|
|
79
|
+
hoverClassName,
|
|
80
|
+
...rest
|
|
81
|
+
}) => {
|
|
82
|
+
const [hovered, setHovered] = useState(false);
|
|
83
|
+
return (
|
|
84
|
+
<Pressable
|
|
85
|
+
{...rest}
|
|
86
|
+
className={hovered ? `${baseClassName} ${hoverClassName}` : baseClassName}
|
|
87
|
+
onHoverIn={() => setHovered(true)}
|
|
88
|
+
onHoverOut={() => setHovered(false)}
|
|
89
|
+
/>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
66
93
|
/**
|
|
67
94
|
* Leading glyph for the rows that live in a Bloom grouped section (the MENU
|
|
68
95
|
* block) and for the storage card's cloud, which lines its title up with them.
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type React from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import { Pressable, View } from 'react-native-css/components';
|
|
8
|
+
import { Pressable, View } from 'react-native';
|
|
10
9
|
import MaterialCommunityIcons from '../../icons/MaterialCommunityIcons';
|
|
11
10
|
import { Avatar } from '@oxy.so/bloom/avatar';
|
|
12
11
|
import { BloomColorScope } from '@oxy.so/bloom/theme';
|
|
@@ -18,34 +17,6 @@ import { resolveAccentHex, toPreset, type Theme } from './types';
|
|
|
18
17
|
/** Diameter of a row avatar (the sign-in view's account rows). */
|
|
19
18
|
const ROW_AVATAR_SIZE = 40;
|
|
20
19
|
|
|
21
|
-
type HoverPressableProps = Omit<React.ComponentProps<typeof Pressable>, 'className'> & {
|
|
22
|
-
baseClassName: string;
|
|
23
|
-
hoverClassName: string;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* A `Pressable` that appends a hover-tint NativeWind token while pointer-hovered.
|
|
28
|
-
* The Metro web pipeline here does NOT emit NativeWind `hover:` variants, so hover
|
|
29
|
-
* is driven by RN's cross-platform `onHoverIn`/`onHoverOut` (they fire only on web
|
|
30
|
-
* via react-native-web; a no-op on native) toggling a plain background token —
|
|
31
|
-
* the tint stays a NativeWind class, only the trigger is JS.
|
|
32
|
-
*/
|
|
33
|
-
export const HoverPressable: React.FC<HoverPressableProps> = ({
|
|
34
|
-
baseClassName,
|
|
35
|
-
hoverClassName,
|
|
36
|
-
...rest
|
|
37
|
-
}) => {
|
|
38
|
-
const [hovered, setHovered] = useState(false);
|
|
39
|
-
return (
|
|
40
|
-
<Pressable
|
|
41
|
-
{...rest}
|
|
42
|
-
className={hovered ? `${baseClassName} ${hoverClassName}` : baseClassName}
|
|
43
|
-
onHoverIn={() => setHovered(true)}
|
|
44
|
-
onHoverOut={() => setHovered(false)}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
20
|
/**
|
|
50
21
|
* A SUBORDINATE action: a small centred text link, never a button.
|
|
51
22
|
*
|
|
@@ -73,15 +44,6 @@ export const SubtleLink: React.FC<{
|
|
|
73
44
|
</Pressable>
|
|
74
45
|
);
|
|
75
46
|
|
|
76
|
-
/** A labelled hairline separating two blocks ("or"). */
|
|
77
|
-
export const Dividerish: React.FC<{ theme: Theme; label: string }> = ({ theme, label }) => (
|
|
78
|
-
<View style={styles.dividerRow}>
|
|
79
|
-
<View style={[styles.dividerLine, { backgroundColor: theme.colors.border }]} />
|
|
80
|
-
<Text style={[styles.dividerText, { color: theme.colors.textSecondary }]}>{label}</Text>
|
|
81
|
-
<View style={[styles.dividerLine, { backgroundColor: theme.colors.border }]} />
|
|
82
|
-
</View>
|
|
83
|
-
);
|
|
84
|
-
|
|
85
47
|
/**
|
|
86
48
|
* A `principal acting as account` row on the sign-in entry — "continue as one of
|
|
87
49
|
* these" rather than a choice of authentication METHOD, which is why it stays
|
|
@@ -9,18 +9,12 @@
|
|
|
9
9
|
import type { SignInFailureReason } from '@oxy.so/core';
|
|
10
10
|
import type { Translate } from './types';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* The toast for `failure`, or `null` when there is nothing to report: a
|
|
14
|
-
* `'cancelled'` attempt is the user's own choice (they closed the window), and
|
|
15
|
-
* the surface already offers "Try again" without scolding them for it.
|
|
16
|
-
*/
|
|
12
|
+
/** The toast for `failure`, or `null` when there is nothing to report. */
|
|
17
13
|
export function signInFailureMessage(
|
|
18
14
|
failure: SignInFailureReason | null,
|
|
19
15
|
t: Translate,
|
|
20
16
|
): string | null {
|
|
21
17
|
switch (failure) {
|
|
22
|
-
case 'cancelled':
|
|
23
|
-
return null;
|
|
24
18
|
case 'denied':
|
|
25
19
|
return t('accountSwitcher.signInFailures.denied');
|
|
26
20
|
case 'expired':
|
|
@@ -140,42 +140,11 @@ export const authChooserStyles = StyleSheet.create({
|
|
|
140
140
|
fontSize: 14,
|
|
141
141
|
fontWeight: '600',
|
|
142
142
|
},
|
|
143
|
-
signInBlock: {
|
|
144
|
-
width: '100%',
|
|
145
|
-
},
|
|
146
143
|
primaryButton: {
|
|
147
144
|
width: '100%',
|
|
148
145
|
borderRadius: 14,
|
|
149
146
|
marginTop: 8,
|
|
150
147
|
},
|
|
151
|
-
secondaryButton: {
|
|
152
|
-
width: '100%',
|
|
153
|
-
borderRadius: 14,
|
|
154
|
-
marginTop: 10,
|
|
155
|
-
},
|
|
156
|
-
usernameInput: {
|
|
157
|
-
width: '100%',
|
|
158
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
159
|
-
borderRadius: 14,
|
|
160
|
-
paddingVertical: 12,
|
|
161
|
-
paddingHorizontal: 14,
|
|
162
|
-
fontSize: 16,
|
|
163
|
-
marginTop: 8,
|
|
164
|
-
},
|
|
165
|
-
dividerRow: {
|
|
166
|
-
flexDirection: 'row',
|
|
167
|
-
alignItems: 'center',
|
|
168
|
-
width: '100%',
|
|
169
|
-
marginVertical: 14,
|
|
170
|
-
},
|
|
171
|
-
dividerLine: {
|
|
172
|
-
flex: 1,
|
|
173
|
-
height: StyleSheet.hairlineWidth,
|
|
174
|
-
},
|
|
175
|
-
dividerText: {
|
|
176
|
-
marginHorizontal: 12,
|
|
177
|
-
fontSize: 13,
|
|
178
|
-
},
|
|
179
148
|
centeredBlock: {
|
|
180
149
|
alignItems: 'center',
|
|
181
150
|
justifyContent: 'center',
|
|
@@ -96,7 +96,7 @@ export interface AccountsMenuActions {
|
|
|
96
96
|
onTerms: () => void;
|
|
97
97
|
onSignOut: () => void;
|
|
98
98
|
/**
|
|
99
|
-
* Open the person's identity at
|
|
99
|
+
* Open the person's identity at auth.oxy.so/identity (recovery phrase,
|
|
100
100
|
* recovery, account deletion). Web only — `undefined` hides the row.
|
|
101
101
|
*/
|
|
102
102
|
onOpenIdentity?: () => void;
|
|
@@ -111,8 +111,8 @@ export interface AccountsMenuActions {
|
|
|
111
111
|
/**
|
|
112
112
|
* Where a passkey sign-in or sign-up can run from the current surface.
|
|
113
113
|
*
|
|
114
|
-
* `'hub'` = web: it runs
|
|
115
|
-
* every web origin
|
|
114
|
+
* `'hub'` = web: it runs in auth.oxy.so's window over the app
|
|
115
|
+
* (`continueOnAuth`), on every web origin.
|
|
116
116
|
* `'none'` = native, where Commons owns identity.
|
|
117
117
|
*/
|
|
118
118
|
export type PasskeyMode = 'hub' | 'none';
|
|
@@ -52,7 +52,7 @@ export interface OpenAuthorizeOptions {
|
|
|
52
52
|
* (see `normalizeOAuthRedirectUri`), so the IdP always returns the tab to `/`,
|
|
53
53
|
* and the return handlers restore this path. Doing it here rather than at each
|
|
54
54
|
* call site is deliberate: every web authorize redirect — silent restore,
|
|
55
|
-
* interactive sign-in,
|
|
55
|
+
* interactive sign-in, `continueOnAuth` — funnels through this function, so a
|
|
56
56
|
* new flow cannot forget to preserve the page the visitor came from.
|
|
57
57
|
*/
|
|
58
58
|
export function redirectToAuthorize(url: string): void {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sign-in entry's embedded QR, over the split card's photo carousel: scan
|
|
3
|
+
* it with Commons on a phone and this screen is signed in.
|
|
4
|
+
*
|
|
5
|
+
* It owns one QR-only request (`controller.startInlineQr()`): started the
|
|
6
|
+
* first time the block is actually laid out on screen — never while its column
|
|
7
|
+
* is hidden below `md` — renewed when it expires, and withdrawn when the block
|
|
8
|
+
* goes away while it is still approvable. It never pushes to a phone or opens Commons —
|
|
9
|
+
* the person did not ask for either by opening the screen. Any other sign-in
|
|
10
|
+
* they choose supersedes it like any new attempt.
|
|
11
|
+
*
|
|
12
|
+
* Anti-phishing: the plate encodes `signIn.qrPayload` and renders nothing
|
|
13
|
+
* derived from it; the approver resolves the app server-side.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type React from 'react';
|
|
17
|
+
import { useEffect, useState } from 'react';
|
|
18
|
+
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
19
|
+
import QRCode from 'react-native-qrcode-svg';
|
|
20
|
+
import { Button } from '@oxy.so/bloom/button';
|
|
21
|
+
import { RiCheckboxCircleLine } from '@oxy.so/bloom/icons/RiCheckboxCircleLine';
|
|
22
|
+
import { RiRefreshLine } from '@oxy.so/bloom/icons/RiRefreshLine';
|
|
23
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
24
|
+
import { Text } from '@oxy.so/bloom/typography';
|
|
25
|
+
import type { AccountDialogController } from '@oxy.so/core';
|
|
26
|
+
import { useI18n } from '../../hooks/useI18n';
|
|
27
|
+
import { useAccountDialogSnapshot } from '../../hooks/accountDialogSnapshot';
|
|
28
|
+
|
|
29
|
+
/** High-contrast, un-themed on purpose: scan reliability. */
|
|
30
|
+
const QR_PLATE_BG = '#FFFFFF';
|
|
31
|
+
const QR_FOREGROUND = '#000000';
|
|
32
|
+
const QR_SIZE = 112;
|
|
33
|
+
const PLATE_PADDING = 8;
|
|
34
|
+
const PLATE_SIZE = QR_SIZE + PLATE_PADDING * 2;
|
|
35
|
+
|
|
36
|
+
export const InlineCommonsQr: React.FC<{ controller: AccountDialogController | null }> = ({ controller }) => {
|
|
37
|
+
const theme = useTheme();
|
|
38
|
+
const { t } = useI18n();
|
|
39
|
+
const { signIn } = useAccountDialogSnapshot(controller);
|
|
40
|
+
const live = signIn.inline && (signIn.phase === 'starting' || signIn.phase === 'waiting');
|
|
41
|
+
const expired = signIn.inline && signIn.phase === 'error' && signIn.failure === 'expired';
|
|
42
|
+
|
|
43
|
+
// Laid out with a size only where its column shows (`display: none` below
|
|
44
|
+
// `md` lays out empty), so that is when a request is worth having.
|
|
45
|
+
const [shown, setShown] = useState(false);
|
|
46
|
+
|
|
47
|
+
// One request for as long as the block is on screen. Withdrawn on the way
|
|
48
|
+
// out only while it is still ours and still approvable: an attempt the
|
|
49
|
+
// person started meanwhile (a passkey window, "Continue with Oxy") is theirs.
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!controller || !shown) return;
|
|
52
|
+
const { signIn: current } = controller.getSnapshot();
|
|
53
|
+
if (!(current.inline && (current.phase === 'starting' || current.phase === 'waiting'))) {
|
|
54
|
+
void controller.startInlineQr();
|
|
55
|
+
}
|
|
56
|
+
return () => {
|
|
57
|
+
const { signIn: last } = controller.getSnapshot();
|
|
58
|
+
if (last.inline && (last.phase === 'starting' || last.phase === 'waiting')) controller.cancelSignIn();
|
|
59
|
+
};
|
|
60
|
+
}, [controller, shown]);
|
|
61
|
+
|
|
62
|
+
// A code only lives a few minutes; an expired one is replaced, not reported.
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (controller && expired) void controller.startInlineQr();
|
|
65
|
+
}, [controller, expired]);
|
|
66
|
+
|
|
67
|
+
let plate: React.ReactNode;
|
|
68
|
+
if (signIn.inline && signIn.progress === 'identity-confirmed') {
|
|
69
|
+
plate = <RiCheckboxCircleLine size="3xl" fill={theme.colors.success} />;
|
|
70
|
+
} else if (live && signIn.qrPayload && signIn.progress !== 'confirming-identity') {
|
|
71
|
+
plate = <QRCode value={signIn.qrPayload} size={QR_SIZE} backgroundColor={QR_PLATE_BG} color={QR_FOREGROUND} />;
|
|
72
|
+
} else if (live || expired || (signIn.inline && signIn.phase === 'completed')) {
|
|
73
|
+
plate = <ActivityIndicator size="large" color={QR_FOREGROUND} />;
|
|
74
|
+
} else {
|
|
75
|
+
// Failed for a reason renewing will not fix by itself, or superseded and
|
|
76
|
+
// then withdrawn: one press for a new code.
|
|
77
|
+
plate = (
|
|
78
|
+
<Button
|
|
79
|
+
appearance="plain"
|
|
80
|
+
tone="neutral"
|
|
81
|
+
size="sm"
|
|
82
|
+
iconOnly
|
|
83
|
+
leadingIcon={RiRefreshLine}
|
|
84
|
+
accessibilityLabel={t('signin.qr.renew')}
|
|
85
|
+
onPress={() => void controller?.startInlineQr()}
|
|
86
|
+
testID="inline-qr-renew"
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<View
|
|
93
|
+
style={styles.block}
|
|
94
|
+
testID="inline-commons-qr"
|
|
95
|
+
onLayout={(event) => {
|
|
96
|
+
if (event.nativeEvent.layout.width > 0) setShown(true);
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<View style={[styles.plate, { borderColor: theme.colors.border }]}>{plate}</View>
|
|
100
|
+
<Text style={[styles.caption, styles.captionOnMedia]}>
|
|
101
|
+
{t('signin.qr.caption')}
|
|
102
|
+
</Text>
|
|
103
|
+
</View>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
block: {
|
|
109
|
+
width: PLATE_SIZE,
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
gap: 6,
|
|
112
|
+
},
|
|
113
|
+
plate: {
|
|
114
|
+
width: PLATE_SIZE,
|
|
115
|
+
height: PLATE_SIZE,
|
|
116
|
+
padding: PLATE_PADDING,
|
|
117
|
+
borderRadius: 12,
|
|
118
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
119
|
+
backgroundColor: QR_PLATE_BG,
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
},
|
|
123
|
+
caption: {
|
|
124
|
+
fontSize: 12,
|
|
125
|
+
lineHeight: 16,
|
|
126
|
+
textAlign: 'center',
|
|
127
|
+
},
|
|
128
|
+
captionOnMedia: {
|
|
129
|
+
color: '#FFFFFF',
|
|
130
|
+
fontWeight: '500',
|
|
131
|
+
textShadowColor: 'rgba(0, 0, 0, 0.6)',
|
|
132
|
+
textShadowOffset: { width: 0, height: 1 },
|
|
133
|
+
textShadowRadius: 4,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Choose an account" — every `principal acting as account` pair on this
|
|
3
|
+
* device, then "Use another account".
|
|
4
|
+
*
|
|
5
|
+
* The front screen of sign-in on a returning device, in the account dialog and
|
|
6
|
+
* on every auth.oxy.so page that asks WHO (sign-in, OAuth authorize, device
|
|
7
|
+
* approval, MCP linking). Presentational: the host decides what choosing a row
|
|
8
|
+
* means — a switch, a "Continue as" sign-in, or activating the pair before an
|
|
9
|
+
* OAuth consent — and passes the pair back, never an account id, which cannot
|
|
10
|
+
* say whose route was chosen.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type React from 'react';
|
|
14
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
15
|
+
import { RiArrowRightSLine } from '@oxy.so/bloom/icons/RiArrowRightSLine';
|
|
16
|
+
import { RiUserAddLine } from '@oxy.so/bloom/icons/RiUserAddLine';
|
|
17
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
18
|
+
import { Text } from '@oxy.so/bloom/typography';
|
|
19
|
+
import { showsPrincipalHeaders, type SwitcherContextRow, type SwitcherPrincipalRow } from '@oxy.so/core';
|
|
20
|
+
import { useI18n } from '../../hooks/useI18n';
|
|
21
|
+
import { AccountRow } from '../authChooser/primitives';
|
|
22
|
+
import { authChooserStyles } from '../authChooser/styles';
|
|
23
|
+
import { OxyAuthScreen, OxyAuthScreenHeader, OxyAuthTerms } from './OxyAuthScreen';
|
|
24
|
+
|
|
25
|
+
export interface OxyAccountPickerProps {
|
|
26
|
+
/** The device's people, each with the accounts they may act as (`useDeviceSwitcher`). */
|
|
27
|
+
principals: SwitcherPrincipalRow[];
|
|
28
|
+
/** The app being continued to, when there is one. */
|
|
29
|
+
appName?: string | null;
|
|
30
|
+
onSelectContext: (context: SwitcherContextRow) => void;
|
|
31
|
+
/** "Use another account" — the host reveals its sign-in. */
|
|
32
|
+
onUseAnother: () => void;
|
|
33
|
+
/** The pair being activated, whose row shows it is busy. */
|
|
34
|
+
pendingContextId?: string | null;
|
|
35
|
+
/** Disables every row while a choice is in flight. */
|
|
36
|
+
isLoading?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* This origin holds no session. A row then reads "Continue as @handle" and
|
|
39
|
+
* never as the current account: the device can list an identity as active
|
|
40
|
+
* while nobody is signed in HERE.
|
|
41
|
+
*/
|
|
42
|
+
signedOut?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const OxyAccountPicker: React.FC<OxyAccountPickerProps> = ({
|
|
46
|
+
principals,
|
|
47
|
+
appName,
|
|
48
|
+
onSelectContext,
|
|
49
|
+
onUseAnother,
|
|
50
|
+
pendingContextId = null,
|
|
51
|
+
isLoading = false,
|
|
52
|
+
signedOut = false,
|
|
53
|
+
}) => {
|
|
54
|
+
const theme = useTheme();
|
|
55
|
+
const { t } = useI18n();
|
|
56
|
+
// Whose route a row is only needs naming once someone holds more than one
|
|
57
|
+
// account here — the same rule the account menu's group headers follow.
|
|
58
|
+
const namesTheOperator = showsPrincipalHeaders(principals);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<OxyAuthScreen>
|
|
62
|
+
<OxyAuthScreenHeader
|
|
63
|
+
title={t('signin.chooser.title')}
|
|
64
|
+
description={appName ? t('signin.chooser.subtitleToApp', { app: appName }) : t('signin.chooser.subtitle')}
|
|
65
|
+
/>
|
|
66
|
+
<View style={authChooserStyles.rows}>
|
|
67
|
+
{principals.flatMap((principal) =>
|
|
68
|
+
principal.contexts.map((context) => (
|
|
69
|
+
<AccountRow
|
|
70
|
+
key={context.contextId}
|
|
71
|
+
context={context}
|
|
72
|
+
operatedBy={
|
|
73
|
+
namesTheOperator && context.isDelegated
|
|
74
|
+
? t('accountSwitcher.context.operatedBy', { name: principal.displayName })
|
|
75
|
+
: null
|
|
76
|
+
}
|
|
77
|
+
continueAsLabel={
|
|
78
|
+
signedOut
|
|
79
|
+
? t('signin.chooser.continueAs', {
|
|
80
|
+
name: context.handle ? `@${context.handle}` : context.displayName,
|
|
81
|
+
})
|
|
82
|
+
: null
|
|
83
|
+
}
|
|
84
|
+
theme={theme}
|
|
85
|
+
activating={pendingContextId === context.contextId}
|
|
86
|
+
disabled={isLoading}
|
|
87
|
+
onPress={() => onSelectContext(context)}
|
|
88
|
+
/>
|
|
89
|
+
)),
|
|
90
|
+
)}
|
|
91
|
+
<Pressable
|
|
92
|
+
onPress={onUseAnother}
|
|
93
|
+
disabled={isLoading}
|
|
94
|
+
accessibilityRole="button"
|
|
95
|
+
accessibilityLabel={t('signin.chooser.useAnother')}
|
|
96
|
+
style={[
|
|
97
|
+
authChooserStyles.accountRow,
|
|
98
|
+
{ borderColor: theme.colors.border, backgroundColor: theme.colors.card },
|
|
99
|
+
isLoading ? authChooserStyles.rowDisabled : null,
|
|
100
|
+
]}
|
|
101
|
+
testID="use-another-account"
|
|
102
|
+
>
|
|
103
|
+
<View style={[styles.addGlyph, { backgroundColor: theme.colors.backgroundSecondary }]}>
|
|
104
|
+
<RiUserAddLine size="md" fill={theme.colors.textSecondary} />
|
|
105
|
+
</View>
|
|
106
|
+
<Text style={[authChooserStyles.rowName, styles.addLabel, { color: theme.colors.text }]}>
|
|
107
|
+
{t('signin.chooser.useAnother')}
|
|
108
|
+
</Text>
|
|
109
|
+
<RiArrowRightSLine size="md" fill={theme.colors.textSecondary} />
|
|
110
|
+
</Pressable>
|
|
111
|
+
</View>
|
|
112
|
+
<OxyAuthTerms />
|
|
113
|
+
</OxyAuthScreen>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
// Matches `AccountRow`'s 40px avatar plus its 2px ring and 1px gap.
|
|
119
|
+
addGlyph: {
|
|
120
|
+
width: 46,
|
|
121
|
+
height: 46,
|
|
122
|
+
borderRadius: 23,
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
justifyContent: 'center',
|
|
125
|
+
},
|
|
126
|
+
addLabel: {
|
|
127
|
+
flex: 1,
|
|
128
|
+
},
|
|
129
|
+
});
|