@oxyhq/services 22.12.4 → 22.13.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 +16 -46
- package/lib/commonjs/index.js +18 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -13
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +27 -4
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +72 -1123
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +50 -12
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -4
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +74 -40
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +527 -0
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +90 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +144 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js +188 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +63 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js +169 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +149 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js +54 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/commonjs/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/types.js +59 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +50 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +205 -30
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +46 -0
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +0 -13
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +170 -0
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js +78 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js +53 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js +276 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js +141 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/commonjs/ui/oauth/types.js +2 -0
- package/lib/commonjs/ui/oauth/types.js.map +1 -0
- package/lib/commonjs/ui/server.js +2 -5
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/session/authStore.js +6 -75
- package/lib/commonjs/ui/session/authStore.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +11 -3
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/commonjs/ui/session/identityBinding.js +95 -0
- package/lib/commonjs/ui/session/identityBinding.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +13 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/nativeSecureStorage.js +90 -0
- package/lib/commonjs/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/commonjs/ui/session/tokenTransport.js +11 -1
- package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +5 -4
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/commonjs/ui/utils/deliveryPlatform.js +58 -0
- package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +72 -46
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +9 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/client.js +0 -1
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +27 -4
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +76 -1128
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +50 -12
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +4 -4
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +76 -42
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +523 -0
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js +85 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js +139 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignUpView.js +184 -0
- package/lib/module/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +59 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/module/ui/components/authChooser/primitives.js +163 -0
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js +139 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/module/ui/components/authChooser/signInProgress.js +50 -0
- package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/module/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/module/ui/components/authChooser/styles.js.map +1 -0
- package/lib/module/ui/components/authChooser/types.js +55 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +46 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +208 -33
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +45 -0
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +0 -1
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +167 -0
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/module/ui/oauth/completeOAuthCode.js +75 -0
- package/lib/module/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/module/ui/oauth/oauthHandshake.js +50 -0
- package/lib/module/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopup.js +268 -0
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js +135 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/module/ui/oauth/types.js +2 -0
- package/lib/module/ui/oauth/types.js.map +1 -0
- package/lib/module/ui/server.js +0 -2
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/session/authStore.js +5 -75
- package/lib/module/ui/session/authStore.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +11 -3
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/ui/session/identityBinding.js +89 -0
- package/lib/module/ui/session/identityBinding.js.map +1 -0
- package/lib/module/ui/session/index.js +5 -2
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/nativeSecureStorage.js +88 -0
- package/lib/module/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/module/ui/session/tokenTransport.js +11 -1
- package/lib/module/ui/session/tokenTransport.js.map +1 -1
- package/lib/module/ui/utils/crossOriginRestore.js +6 -5
- package/lib/module/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/module/ui/utils/deliveryPlatform.js +55 -0
- package/lib/module/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +73 -47
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -1
- package/lib/typescript/commonjs/ui/client.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 +21 -29
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +17 -12
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +43 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +54 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{module/ui/components/oxyAuthChooserStyles.d.ts → commonjs/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +85 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.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 +40 -0
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +0 -1
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +83 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/server.d.ts +0 -2
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +6 -2
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +30 -16
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -1
- package/lib/typescript/module/ui/client.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 +21 -29
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +17 -12
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +43 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +54 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/components/oxyAuthChooserStyles.d.ts → module/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +85 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.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 +40 -0
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +0 -1
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +83 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/module/ui/oauth/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/server.d.ts +0 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/module/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +6 -2
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +30 -16
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/package.json +6 -8
- package/src/index.ts +19 -5
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
- package/src/ui/boot/runProviderColdBoot.ts +83 -13
- package/src/ui/client.ts +0 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +33 -4
- package/src/ui/components/OxyAuthChooser.tsx +100 -1230
- package/src/ui/components/OxyConsentScreen.tsx +56 -13
- package/src/ui/components/OxyProvider.tsx +4 -4
- package/src/ui/components/OxySignInButton.tsx +119 -78
- package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +27 -0
- package/src/ui/components/authChooser/AccountsMenuView.tsx +569 -0
- package/src/ui/components/authChooser/SignInEntryView.tsx +115 -0
- package/src/ui/components/authChooser/SignInRequestView.tsx +163 -0
- package/src/ui/components/authChooser/SignUpView.tsx +174 -0
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +81 -0
- package/src/ui/components/authChooser/primitives.tsx +144 -0
- package/src/ui/components/authChooser/requestSurfaces.tsx +116 -0
- package/src/ui/components/authChooser/signInProgress.ts +54 -0
- package/src/ui/components/{oxyAuthChooserStyles.ts → authChooser/styles.ts} +18 -0
- package/src/ui/components/authChooser/types.ts +101 -0
- package/src/ui/components/authChooser/useUsernameAvailability.ts +60 -0
- package/src/ui/context/OxyContext.tsx +226 -24
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +102 -0
- package/src/ui/context/commitSessionFlow.ts +64 -0
- package/src/ui/context/hooks/useAuthOperations.ts +26 -1
- package/src/ui/context/oxyContextTypes.ts +45 -1
- package/src/ui/context/useOxyAccountGraph.ts +19 -5
- package/src/ui/hooks/useSwitchableAccounts.ts +12 -1
- package/src/ui/index.ts +0 -1
- package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +335 -0
- package/src/ui/oauth/__tests__/completeOAuthCode.test.ts +142 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +352 -0
- package/src/ui/oauth/__tests__/oauthPopupMessages.test.ts +189 -0
- package/src/ui/oauth/__tests__/sharedCompletionPath.test.ts +174 -0
- package/src/ui/oauth/browserAuthTransport.ts +193 -0
- package/src/ui/oauth/completeOAuthCode.ts +93 -0
- package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
- package/src/ui/oauth/oauthHandshake.ts +74 -0
- package/src/ui/oauth/oauthPopup.ts +277 -0
- package/src/ui/oauth/oauthPopupMessages.ts +136 -0
- package/src/ui/oauth/types.ts +150 -0
- package/src/ui/server.ts +0 -2
- package/src/ui/session/__tests__/createSessionClient.test.ts +26 -0
- package/src/ui/session/__tests__/tokenTransport.test.ts +34 -0
- package/src/ui/session/authStore.ts +5 -89
- package/src/ui/session/createSessionClient.ts +15 -2
- package/src/ui/session/identityBinding.ts +116 -0
- package/src/ui/session/index.ts +6 -2
- package/src/ui/session/nativeSecureStorage.ts +98 -0
- package/src/ui/session/tokenTransport.ts +14 -1
- package/src/ui/types/navigation.ts +44 -1
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +17 -0
- package/src/ui/utils/crossOriginRestore.ts +9 -13
- package/src/ui/utils/deliveryPlatform.ts +65 -0
- package/src/ui/utils/oauthReturn.ts +79 -65
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/ui/components/FontLoader.js +0 -35
- package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
- package/lib/commonjs/ui/components/FontLoader.native.js +0 -88
- package/lib/commonjs/ui/components/FontLoader.native.js.map +0 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/ui/components/FontLoader.js +0 -29
- package/lib/module/ui/components/FontLoader.js.map +0 -1
- package/lib/module/ui/components/FontLoader.native.js +0 -83
- package/lib/module/ui/components/FontLoader.native.js.map +0 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/src/ui/components/FontLoader.native.tsx +0 -88
- package/src/ui/components/FontLoader.tsx +0 -27
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ACTIVE REQUEST surface (`qr` view) — the route Oxy chose, plus honest
|
|
3
|
+
* progress (issue #691, Phase 5).
|
|
4
|
+
*
|
|
5
|
+
* The user already performed their one action. From here the surface only
|
|
6
|
+
* REPORTS: the route-appropriate primary visual (`RequestPrimarySurface`), the
|
|
7
|
+
* status line derived from the controller's real signals
|
|
8
|
+
* (`signInProgressLabel`), and nothing else at the same weight. Alternatives
|
|
9
|
+
* stay behind "Having trouble?" until `signIn.routeFailed` says the chosen route
|
|
10
|
+
* could not be carried out — the controller never silently cascades, so
|
|
11
|
+
* revealing them is this view's decision and this view's alone.
|
|
12
|
+
*
|
|
13
|
+
* Two surfaces take over when there is no working primary route to report on:
|
|
14
|
+
* - a FAILED request, whose reason is toasted by the container (never inline),
|
|
15
|
+
* leaves "Try again" as the primary action with the alternatives revealed;
|
|
16
|
+
* - a native device with NO Commons installed, where a same-device QR would be
|
|
17
|
+
* a dead end. There, "Get Commons" is the genuine primary route — not a
|
|
18
|
+
* fallback — so it renders as the one primary action and the QR handoff moves
|
|
19
|
+
* behind the disclosure ("I have Commons on another device").
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type React from 'react';
|
|
23
|
+
import { useState } from 'react';
|
|
24
|
+
import { View } from 'react-native';
|
|
25
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
26
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
27
|
+
import type { AccountDialogSnapshot } from '@oxyhq/core';
|
|
28
|
+
import TroubleDisclosure, { type TroubleAction } from './TroubleDisclosure';
|
|
29
|
+
import { SubtleLink } from './primitives';
|
|
30
|
+
import { GetCommonsPrompt, RequestPrimarySurface } from './requestSurfaces';
|
|
31
|
+
import { signInProgressLabel } from './signInProgress';
|
|
32
|
+
import { authChooserStyles as styles } from './styles';
|
|
33
|
+
import type { SignInAlternatives, Theme, Translate } from './types';
|
|
34
|
+
|
|
35
|
+
interface SignInRequestViewProps {
|
|
36
|
+
snapshot: AccountDialogSnapshot;
|
|
37
|
+
theme: Theme;
|
|
38
|
+
t: Translate;
|
|
39
|
+
/** Restart the request after a failure. */
|
|
40
|
+
onRetry: () => void;
|
|
41
|
+
alternatives: SignInAlternatives;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const SignInRequestView: React.FC<SignInRequestViewProps> = ({
|
|
45
|
+
snapshot,
|
|
46
|
+
theme,
|
|
47
|
+
t,
|
|
48
|
+
onRetry,
|
|
49
|
+
alternatives,
|
|
50
|
+
}) => {
|
|
51
|
+
const { signIn, commonsAvailability } = snapshot;
|
|
52
|
+
// Set only from the disclosure's own "I have Commons on another device" —
|
|
53
|
+
// an explicit user choice to leave the acquisition surface, never inferred.
|
|
54
|
+
const [qrRequested, setQrRequested] = useState(false);
|
|
55
|
+
|
|
56
|
+
// A ceremony is pointless once the request is already being confirmed, and a
|
|
57
|
+
// ceremony FAILURE is toasted by the container — this link never renders an
|
|
58
|
+
// error of its own (owner mandate).
|
|
59
|
+
const passkeyAction: TroubleAction[] =
|
|
60
|
+
alternatives.passkeyAvailable && signIn.phase !== 'authorized' && signIn.phase !== 'completed'
|
|
61
|
+
? [
|
|
62
|
+
{
|
|
63
|
+
key: 'passkey-signin-link',
|
|
64
|
+
label: alternatives.passkeyPending
|
|
65
|
+
? t('accountSwitcher.passkeySigningIn')
|
|
66
|
+
: t('accountSwitcher.useIdentityOnDevice'),
|
|
67
|
+
onPress: alternatives.onSignInWithPasskey,
|
|
68
|
+
disabled: alternatives.passkeyPending,
|
|
69
|
+
},
|
|
70
|
+
]
|
|
71
|
+
: [];
|
|
72
|
+
|
|
73
|
+
const signUpLink = (
|
|
74
|
+
// Account CREATION is not an authentication method, and on web this surface
|
|
75
|
+
// is the FIRST one a signed-out user sees (the entry auto-starts straight
|
|
76
|
+
// through it) — so the way in for someone with no Oxy ID stays visible as a
|
|
77
|
+
// subordinate link rather than hiding behind a troubleshooting affordance.
|
|
78
|
+
<SubtleLink
|
|
79
|
+
label={t('signin.createAccountLink')}
|
|
80
|
+
theme={theme}
|
|
81
|
+
onPress={alternatives.onCreateAccount}
|
|
82
|
+
testID="create-account-link"
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
if (signIn.phase === 'error') {
|
|
87
|
+
return (
|
|
88
|
+
<View style={styles.centeredBlock}>
|
|
89
|
+
<Button variant="primary" onPress={onRetry} style={styles.primaryButton}>
|
|
90
|
+
{t('common.actions.tryAgain')}
|
|
91
|
+
</Button>
|
|
92
|
+
{signUpLink}
|
|
93
|
+
<TroubleDisclosure actions={passkeyAction} revealed theme={theme} t={t} />
|
|
94
|
+
</View>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (commonsAvailability === 'unavailable' && !qrRequested) {
|
|
99
|
+
return (
|
|
100
|
+
<View style={styles.centeredBlock}>
|
|
101
|
+
<GetCommonsPrompt theme={theme} t={t} onGetCommons={alternatives.onGetCommons} />
|
|
102
|
+
{signUpLink}
|
|
103
|
+
<TroubleDisclosure
|
|
104
|
+
actions={[
|
|
105
|
+
{
|
|
106
|
+
key: 'show-qr-anyway-link',
|
|
107
|
+
label: t('accountSwitcher.showQrAnyway'),
|
|
108
|
+
onPress: () => setQrRequested(true),
|
|
109
|
+
},
|
|
110
|
+
...passkeyAction,
|
|
111
|
+
]}
|
|
112
|
+
revealed={false}
|
|
113
|
+
theme={theme}
|
|
114
|
+
t={t}
|
|
115
|
+
/>
|
|
116
|
+
</View>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const status = signInProgressLabel(signIn.progress, signIn.route, t);
|
|
121
|
+
const troubleActions: TroubleAction[] = [
|
|
122
|
+
// Redundant while the QR already IS the primary surface.
|
|
123
|
+
...(signIn.route === 'qr'
|
|
124
|
+
? []
|
|
125
|
+
: [
|
|
126
|
+
{
|
|
127
|
+
key: 'scan-qr-link',
|
|
128
|
+
label: t('accountSwitcher.scanQr'),
|
|
129
|
+
onPress: alternatives.onShowQr,
|
|
130
|
+
},
|
|
131
|
+
]),
|
|
132
|
+
...passkeyAction,
|
|
133
|
+
{
|
|
134
|
+
key: 'get-commons-link',
|
|
135
|
+
label: t('accountSwitcher.getCommons'),
|
|
136
|
+
onPress: alternatives.onGetCommons,
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<View style={styles.centeredBlock}>
|
|
142
|
+
<RequestPrimarySurface signIn={signIn} theme={theme} t={t} />
|
|
143
|
+
{status ? (
|
|
144
|
+
<Text
|
|
145
|
+
style={[styles.mutedText, { color: theme.colors.textSecondary }]}
|
|
146
|
+
accessibilityLiveRegion="polite"
|
|
147
|
+
testID="signin-progress"
|
|
148
|
+
>
|
|
149
|
+
{status}
|
|
150
|
+
</Text>
|
|
151
|
+
) : null}
|
|
152
|
+
{signUpLink}
|
|
153
|
+
<TroubleDisclosure
|
|
154
|
+
actions={troubleActions}
|
|
155
|
+
revealed={signIn.routeFailed}
|
|
156
|
+
theme={theme}
|
|
157
|
+
t={t}
|
|
158
|
+
/>
|
|
159
|
+
</View>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default SignInRequestView;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account creation (`signup` view).
|
|
3
|
+
*
|
|
4
|
+
* Commons is ALWAYS the priority path (owner mandate) and leads everywhere it
|
|
5
|
+
* appears: native shows only "Create your identity in Commons" (or "Get Commons"
|
|
6
|
+
* first, when it is not installed); web on a first-party Oxy origin leads with
|
|
7
|
+
* the SAME "Get Commons" CTA, with inline passkey creation offered UNDERNEATH as
|
|
8
|
+
* the de-emphasized "don't want to install anything" alternative — never
|
|
9
|
+
* co-equal, never a competing button. Anywhere else (a non-Oxy web origin,
|
|
10
|
+
* before the b2 hub-relay ships) shows an honest "not available here yet"
|
|
11
|
+
* handoff instead of a broken button.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type React from 'react';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import { TextInput, View } from 'react-native';
|
|
17
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
18
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
19
|
+
import type { AccountDialogSnapshot, OxyServices } from '@oxyhq/core';
|
|
20
|
+
import { isWebBrowser } from '../../utils/isWebBrowser';
|
|
21
|
+
import { Dividerish, SubtleLink } from './primitives';
|
|
22
|
+
import { authChooserStyles as styles } from './styles';
|
|
23
|
+
import type { PasskeyMode, Theme, Translate } from './types';
|
|
24
|
+
import { useUsernameAvailability, type UsernameStatus } from './useUsernameAvailability';
|
|
25
|
+
|
|
26
|
+
interface SignUpViewProps {
|
|
27
|
+
snapshot: AccountDialogSnapshot;
|
|
28
|
+
theme: Theme;
|
|
29
|
+
t: Translate;
|
|
30
|
+
oxyServices: OxyServices;
|
|
31
|
+
passkeyMode: PasskeyMode;
|
|
32
|
+
onCreateWithPasskey: (username: string) => void;
|
|
33
|
+
createPending: boolean;
|
|
34
|
+
/** Open the auth.oxy.so hub popup (b2) — the 'hub' mode's only path. */
|
|
35
|
+
onOpenHub: () => void;
|
|
36
|
+
/** Deep-link into Commons' own identity-creation screen (installed only). */
|
|
37
|
+
onCreateIdentityInCommons: () => void;
|
|
38
|
+
/** Open the Commons store listing / landing page for this platform. */
|
|
39
|
+
onGetCommons: () => void;
|
|
40
|
+
onBackToSignIn: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const SignUpView: React.FC<SignUpViewProps> = ({
|
|
44
|
+
snapshot,
|
|
45
|
+
theme,
|
|
46
|
+
t,
|
|
47
|
+
oxyServices,
|
|
48
|
+
passkeyMode,
|
|
49
|
+
onCreateWithPasskey,
|
|
50
|
+
createPending,
|
|
51
|
+
onOpenHub,
|
|
52
|
+
onCreateIdentityInCommons,
|
|
53
|
+
onGetCommons,
|
|
54
|
+
onBackToSignIn,
|
|
55
|
+
}) => {
|
|
56
|
+
const [username, setUsername] = useState('');
|
|
57
|
+
const { status: usernameStatus, check: checkUsername } = useUsernameAvailability(oxyServices, t);
|
|
58
|
+
const canSubmit = username.trim().length >= 3 && usernameStatus === 'available' && !createPending;
|
|
59
|
+
|
|
60
|
+
// Native — Commons owns identity creation. Deep-link straight in when it is
|
|
61
|
+
// installed, else lead with the same "Get Commons" acquisition CTA.
|
|
62
|
+
if (!isWebBrowser()) {
|
|
63
|
+
const commonsInstalled = snapshot.commonsAvailability === 'available';
|
|
64
|
+
return (
|
|
65
|
+
<View style={styles.centeredBlock}>
|
|
66
|
+
<Button
|
|
67
|
+
variant="primary"
|
|
68
|
+
onPress={commonsInstalled ? onCreateIdentityInCommons : onGetCommons}
|
|
69
|
+
style={styles.primaryButton}
|
|
70
|
+
>
|
|
71
|
+
{commonsInstalled ? t('signup.createInCommons') : t('accountSwitcher.getCommons')}
|
|
72
|
+
</Button>
|
|
73
|
+
<SubtleLink label={t('signup.backToSignInLink')} theme={theme} onPress={onBackToSignIn} />
|
|
74
|
+
</View>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Web, first-party Oxy origin. Commons leads with a "Get Commons" CTA; passkey
|
|
79
|
+
// creation is the de-emphasized alternative underneath for someone who doesn't
|
|
80
|
+
// want to install anything — a secondary button introduced by its own "No
|
|
81
|
+
// Commons?" framing, the same subordination the sign-in surfaces use.
|
|
82
|
+
if (passkeyMode === 'direct') {
|
|
83
|
+
return (
|
|
84
|
+
<View style={styles.signInBlock}>
|
|
85
|
+
<Text style={[styles.qrHeadline, { color: theme.colors.text }]}>
|
|
86
|
+
{t('signup.commonsHeadline')}
|
|
87
|
+
</Text>
|
|
88
|
+
<Text style={[styles.mutedText, { color: theme.colors.textSecondary }]}>
|
|
89
|
+
{t('signup.commonsExplainer')}
|
|
90
|
+
</Text>
|
|
91
|
+
<Button variant="primary" onPress={onGetCommons} style={styles.primaryButton}>
|
|
92
|
+
{t('accountSwitcher.getCommons')}
|
|
93
|
+
</Button>
|
|
94
|
+
|
|
95
|
+
<Dividerish theme={theme} label={t('signin.or')} />
|
|
96
|
+
|
|
97
|
+
<Text style={[styles.mutedText, { color: theme.colors.textSecondary }]}>
|
|
98
|
+
{t('signup.passkeyAlternative')}
|
|
99
|
+
</Text>
|
|
100
|
+
<TextInput
|
|
101
|
+
style={[styles.usernameInput, { borderColor: theme.colors.border, color: theme.colors.text }]}
|
|
102
|
+
placeholder={t('signup.usernamePlaceholder')}
|
|
103
|
+
placeholderTextColor={theme.colors.textSecondary}
|
|
104
|
+
value={username}
|
|
105
|
+
autoCapitalize="none"
|
|
106
|
+
autoCorrect={false}
|
|
107
|
+
autoComplete="username"
|
|
108
|
+
onChangeText={(value) => {
|
|
109
|
+
setUsername(value);
|
|
110
|
+
checkUsername(value.trim());
|
|
111
|
+
}}
|
|
112
|
+
testID="signup-username-input"
|
|
113
|
+
/>
|
|
114
|
+
<UsernameStatusText status={usernameStatus} theme={theme} t={t} />
|
|
115
|
+
<Button
|
|
116
|
+
variant="secondary"
|
|
117
|
+
onPress={() => onCreateWithPasskey(username.trim())}
|
|
118
|
+
disabled={!canSubmit}
|
|
119
|
+
style={styles.secondaryButton}
|
|
120
|
+
testID="signup-create-button"
|
|
121
|
+
>
|
|
122
|
+
{createPending ? t('signup.creating') : t('signup.createAccount')}
|
|
123
|
+
</Button>
|
|
124
|
+
<SubtleLink label={t('signup.backToSignInLink')} theme={theme} onPress={onBackToSignIn} />
|
|
125
|
+
</View>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Web, non-Oxy origin (b2): a passkey ceremony cannot run locally here — the
|
|
130
|
+
// same WebAuthn RP-ID boundary the sign-in surfaces hit — so this opens the
|
|
131
|
+
// auth.oxy.so hub popup. Completing EITHER a sign-in OR a fresh sign-up there
|
|
132
|
+
// relays the resulting session back through the SAME poll/socket engine.
|
|
133
|
+
return (
|
|
134
|
+
<View style={styles.centeredBlock}>
|
|
135
|
+
<Text style={[styles.mutedText, { color: theme.colors.textSecondary }]}>
|
|
136
|
+
{t('signup.hubExplainer')}
|
|
137
|
+
</Text>
|
|
138
|
+
<Button variant="primary" onPress={onOpenHub} style={styles.primaryButton}>
|
|
139
|
+
{t('signup.continueInWindow')}
|
|
140
|
+
</Button>
|
|
141
|
+
<SubtleLink label={t('signup.backToSignInLink')} theme={theme} onPress={onBackToSignIn} />
|
|
142
|
+
</View>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** The inline availability verdict. Network FAILURES are toasted, never shown here. */
|
|
147
|
+
const UsernameStatusText: React.FC<{ status: UsernameStatus; theme: Theme; t: Translate }> = ({
|
|
148
|
+
status,
|
|
149
|
+
theme,
|
|
150
|
+
t,
|
|
151
|
+
}) => {
|
|
152
|
+
if (status === 'idle') return null;
|
|
153
|
+
if (status === 'checking') {
|
|
154
|
+
return (
|
|
155
|
+
<Text style={[styles.mutedText, { color: theme.colors.textSecondary }]}>
|
|
156
|
+
{t('signup.usernameChecking')}
|
|
157
|
+
</Text>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
if (status === 'available') {
|
|
161
|
+
return (
|
|
162
|
+
<Text style={[styles.mutedText, { color: theme.colors.success }]}>
|
|
163
|
+
{t('signup.usernameAvailable')}
|
|
164
|
+
</Text>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return (
|
|
168
|
+
<Text style={[styles.mutedText, { color: theme.colors.error }]}>
|
|
169
|
+
{t('signup.usernameTaken')}
|
|
170
|
+
</Text>
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export default SignUpView;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "Having trouble?" progressive disclosure (issue #691, Phase 5).
|
|
3
|
+
*
|
|
4
|
+
* The normal sign-in surface presents ONE primary action. Every alternative —
|
|
5
|
+
* scanning a QR from another device, a passkey on this device, getting Commons,
|
|
6
|
+
* creating an account — lives here, hidden until the user asks for it or the
|
|
7
|
+
* chosen primary route fails.
|
|
8
|
+
*
|
|
9
|
+
* Two renderings, deliberately not one controlled component:
|
|
10
|
+
* - `revealed` (the primary route failed, or there IS no primary route): the
|
|
11
|
+
* alternatives ARE the surface's content now, so they render plainly. There
|
|
12
|
+
* is nothing left to hide them behind.
|
|
13
|
+
* - otherwise: Bloom's own `Collapsible`, whose trigger is the small
|
|
14
|
+
* "Having trouble?" affordance.
|
|
15
|
+
*
|
|
16
|
+
* Splitting on `revealed` is what keeps the open state where it belongs — inside
|
|
17
|
+
* Bloom's uncontrolled disclosure — instead of forcing a hand-rolled controlled
|
|
18
|
+
* copy of it here.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type React from 'react';
|
|
22
|
+
import { View } from 'react-native';
|
|
23
|
+
import { Collapsible } from '@oxyhq/bloom/collapsible';
|
|
24
|
+
import { SubtleLink } from './primitives';
|
|
25
|
+
import { authChooserStyles as styles } from './styles';
|
|
26
|
+
import type { Theme, Translate } from './types';
|
|
27
|
+
|
|
28
|
+
/** One alternative route out of the current surface. Always a subordinate link. */
|
|
29
|
+
export interface TroubleAction {
|
|
30
|
+
/** Stable identity for the list, and the action's `testID`. */
|
|
31
|
+
key: string;
|
|
32
|
+
label: string;
|
|
33
|
+
onPress: () => void;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface TroubleDisclosureProps {
|
|
38
|
+
actions: TroubleAction[];
|
|
39
|
+
/**
|
|
40
|
+
* `true` when the primary route could not be carried out (`signIn.routeFailed`)
|
|
41
|
+
* or the surface has no working primary at all (a failed request). The
|
|
42
|
+
* alternatives are shown without asking.
|
|
43
|
+
*/
|
|
44
|
+
revealed: boolean;
|
|
45
|
+
theme: Theme;
|
|
46
|
+
t: Translate;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const TroubleDisclosure: React.FC<TroubleDisclosureProps> = ({ actions, revealed, theme, t }) => {
|
|
50
|
+
if (actions.length === 0) return null;
|
|
51
|
+
|
|
52
|
+
const links = (
|
|
53
|
+
<View style={styles.troubleActions}>
|
|
54
|
+
{actions.map((action) => (
|
|
55
|
+
<SubtleLink
|
|
56
|
+
key={action.key}
|
|
57
|
+
label={action.label}
|
|
58
|
+
theme={theme}
|
|
59
|
+
onPress={action.onPress}
|
|
60
|
+
disabled={action.disabled}
|
|
61
|
+
testID={action.key}
|
|
62
|
+
/>
|
|
63
|
+
))}
|
|
64
|
+
</View>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
if (revealed) return links;
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Collapsible
|
|
71
|
+
title={t('accountSwitcher.havingTrouble')}
|
|
72
|
+
style={styles.troubleTrigger}
|
|
73
|
+
titleStyle={[styles.linkText, { color: theme.colors.textSecondary }]}
|
|
74
|
+
testID="trouble-disclosure"
|
|
75
|
+
>
|
|
76
|
+
{links}
|
|
77
|
+
</Collapsible>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default TroubleDisclosure;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The small presentational building blocks shared across the auth chooser's
|
|
3
|
+
* views. One responsibility each, no controller access, no side effects — they
|
|
4
|
+
* take props and render.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type React from 'react';
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
import { Pressable, View } from 'react-native';
|
|
10
|
+
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
11
|
+
import { Avatar } from '@oxyhq/bloom/avatar';
|
|
12
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
13
|
+
import { BloomColorScope } from '@oxyhq/bloom/theme';
|
|
14
|
+
import type { SwitchableAccount } from '@oxyhq/core';
|
|
15
|
+
import { authChooserStyles as styles } from './styles';
|
|
16
|
+
import { resolveAccentHex, toPreset, type Theme } from './types';
|
|
17
|
+
|
|
18
|
+
/** Diameter of a row avatar (the sign-in view's account rows). */
|
|
19
|
+
const ROW_AVATAR_SIZE = 40;
|
|
20
|
+
|
|
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
|
+
/**
|
|
50
|
+
* A SUBORDINATE action: a small centred text link, never a button.
|
|
51
|
+
*
|
|
52
|
+
* This is the single visual grammar for everything that is not the surface's one
|
|
53
|
+
* primary action (issue #691) — the sign-up entry, and every alternative revealed
|
|
54
|
+
* behind "Having trouble?". Keeping them all on one component is what stops an
|
|
55
|
+
* alternative from quietly growing into a co-equal button again.
|
|
56
|
+
*/
|
|
57
|
+
export const SubtleLink: React.FC<{
|
|
58
|
+
label: string;
|
|
59
|
+
theme: Theme;
|
|
60
|
+
onPress: () => void;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
testID?: string;
|
|
63
|
+
}> = ({ label, theme, onPress, disabled, testID }) => (
|
|
64
|
+
<Pressable
|
|
65
|
+
onPress={onPress}
|
|
66
|
+
disabled={disabled}
|
|
67
|
+
accessibilityRole="button"
|
|
68
|
+
accessibilityLabel={label}
|
|
69
|
+
style={styles.footerLink}
|
|
70
|
+
testID={testID}
|
|
71
|
+
>
|
|
72
|
+
<Text style={[styles.linkText, { color: theme.colors.textSecondary }]}>{label}</Text>
|
|
73
|
+
</Pressable>
|
|
74
|
+
);
|
|
75
|
+
|
|
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
|
+
/**
|
|
86
|
+
* An account row on the sign-in entry — "continue as one of these" rather than a
|
|
87
|
+
* choice of authentication METHOD, which is why it stays above the primary CTA
|
|
88
|
+
* instead of behind the trouble disclosure.
|
|
89
|
+
*/
|
|
90
|
+
export const AccountRow: React.FC<{
|
|
91
|
+
account: SwitchableAccount;
|
|
92
|
+
theme: Theme;
|
|
93
|
+
switching: boolean;
|
|
94
|
+
disabled: boolean;
|
|
95
|
+
onPress: () => void;
|
|
96
|
+
}> = ({ account, theme, switching, disabled, onPress }) => {
|
|
97
|
+
const accent = resolveAccentHex(account.color, theme.colors.primary);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<BloomColorScope colorPreset={toPreset(account.color)} asChild>
|
|
101
|
+
<Pressable
|
|
102
|
+
style={[
|
|
103
|
+
styles.accountRow,
|
|
104
|
+
{
|
|
105
|
+
borderColor: account.isCurrent ? accent : theme.colors.border,
|
|
106
|
+
backgroundColor: theme.colors.card,
|
|
107
|
+
},
|
|
108
|
+
disabled && !switching ? styles.rowDisabled : null,
|
|
109
|
+
]}
|
|
110
|
+
onPress={onPress}
|
|
111
|
+
disabled={disabled}
|
|
112
|
+
accessibilityRole="button"
|
|
113
|
+
accessibilityState={{ selected: account.isCurrent, disabled }}
|
|
114
|
+
accessibilityLabel={account.displayName}
|
|
115
|
+
>
|
|
116
|
+
<View style={[styles.avatarRing, { borderColor: account.isCurrent ? accent : 'transparent' }]}>
|
|
117
|
+
<Avatar
|
|
118
|
+
source={account.avatarUrl ?? undefined}
|
|
119
|
+
variant="thumb"
|
|
120
|
+
name={account.displayName}
|
|
121
|
+
size={ROW_AVATAR_SIZE}
|
|
122
|
+
/>
|
|
123
|
+
</View>
|
|
124
|
+
<View style={styles.rowMeta}>
|
|
125
|
+
<Text style={[styles.rowName, { color: theme.colors.text }]} numberOfLines={1}>
|
|
126
|
+
{account.displayName}
|
|
127
|
+
</Text>
|
|
128
|
+
{account.email ? (
|
|
129
|
+
<Text style={[styles.rowHandle, { color: theme.colors.textSecondary }]} numberOfLines={1}>
|
|
130
|
+
{account.email}
|
|
131
|
+
</Text>
|
|
132
|
+
) : null}
|
|
133
|
+
</View>
|
|
134
|
+
{switching ? (
|
|
135
|
+
<MaterialCommunityIcons name="loading" size={20} color={accent} />
|
|
136
|
+
) : account.isCurrent ? (
|
|
137
|
+
<MaterialCommunityIcons name="check-circle" size={20} color={accent} />
|
|
138
|
+
) : (
|
|
139
|
+
<MaterialCommunityIcons name="chevron-right" size={20} color={theme.colors.textSecondary} />
|
|
140
|
+
)}
|
|
141
|
+
</Pressable>
|
|
142
|
+
</BloomColorScope>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PRIMARY visual of an active "Sign in with Oxy" request — one surface per
|
|
3
|
+
* route, chosen by {@link RequestPrimarySurface} from the controller's own facts.
|
|
4
|
+
*
|
|
5
|
+
* Each is a leading visual and nothing else: the status sentence underneath is
|
|
6
|
+
* owned by `signInProgressLabel`, and the alternatives by `TroubleDisclosure`.
|
|
7
|
+
* That separation is what keeps exactly one primary action on screen (issue
|
|
8
|
+
* #691) — a surface here can never grow a competing button.
|
|
9
|
+
*
|
|
10
|
+
* Anti-phishing: the QR plate encodes `signIn.qrPayload` and renders NOTHING
|
|
11
|
+
* derived from it. Application identity, origin, and scopes are resolved
|
|
12
|
+
* server-side by the approver (Commons), never read out of the payload here.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type React from 'react';
|
|
16
|
+
import { View } from 'react-native';
|
|
17
|
+
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
18
|
+
import QRCode from 'react-native-qrcode-svg';
|
|
19
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
20
|
+
import { Loading } from '@oxyhq/bloom/loading';
|
|
21
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
22
|
+
import type { SignInFlowState } from '@oxyhq/core';
|
|
23
|
+
import { authChooserStyles as styles } from './styles';
|
|
24
|
+
import type { Theme, Translate } from './types';
|
|
25
|
+
|
|
26
|
+
/** High-contrast QR colors — intentionally fixed (NOT themed) for scan reliability. */
|
|
27
|
+
const QR_PLATE_BG = '#FFFFFF';
|
|
28
|
+
const QR_FOREGROUND = '#000000';
|
|
29
|
+
const QR_SIZE = 196;
|
|
30
|
+
/** The leading route glyph, sized to sit where the QR plate otherwise would. */
|
|
31
|
+
const ROUTE_GLYPH_SIZE = 44;
|
|
32
|
+
|
|
33
|
+
/** The indeterminate leading visual: the request exists but has nothing to show yet. */
|
|
34
|
+
export const PreparingSurface: React.FC = () => <Loading variant="spinner" size="large" />;
|
|
35
|
+
|
|
36
|
+
/** The leading glyph for a route whose surface is elsewhere (the phone, Commons). */
|
|
37
|
+
export const RouteGlyph: React.FC<{
|
|
38
|
+
name: keyof typeof MaterialCommunityIcons.glyphMap;
|
|
39
|
+
color: string;
|
|
40
|
+
}> = ({ name, color }) => (
|
|
41
|
+
<MaterialCommunityIcons name={name} size={ROUTE_GLYPH_SIZE} color={color} />
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
/** The cross-device handoff: a headline over the fixed-contrast QR plate. */
|
|
45
|
+
export const QrPlate: React.FC<{ payload: string; theme: Theme; t: Translate }> = ({
|
|
46
|
+
payload,
|
|
47
|
+
theme,
|
|
48
|
+
t,
|
|
49
|
+
}) => (
|
|
50
|
+
<>
|
|
51
|
+
<Text style={[styles.qrHeadline, { color: theme.colors.text }]}>
|
|
52
|
+
{t('accountSwitcher.qrHeadline')}
|
|
53
|
+
</Text>
|
|
54
|
+
<View style={styles.qrPlate}>
|
|
55
|
+
<QRCode value={payload} size={QR_SIZE} backgroundColor={QR_PLATE_BG} color={QR_FOREGROUND} />
|
|
56
|
+
</View>
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The acquisition surface. For someone with no Commons at all this is the
|
|
62
|
+
* GENUINE primary route, not a fallback — a same-device QR they would have to
|
|
63
|
+
* scan with the very screen showing it is a dead end — so it renders as the
|
|
64
|
+
* surface's one primary action.
|
|
65
|
+
*/
|
|
66
|
+
export const GetCommonsPrompt: React.FC<{
|
|
67
|
+
theme: Theme;
|
|
68
|
+
t: Translate;
|
|
69
|
+
onGetCommons: () => void;
|
|
70
|
+
}> = ({ theme, t, onGetCommons }) => (
|
|
71
|
+
<>
|
|
72
|
+
<Text style={[styles.mutedText, { color: theme.colors.textSecondary }]}>
|
|
73
|
+
{t('accountSwitcher.commonsNotInstalled')}
|
|
74
|
+
</Text>
|
|
75
|
+
<Button
|
|
76
|
+
variant="primary"
|
|
77
|
+
onPress={onGetCommons}
|
|
78
|
+
style={styles.primaryButton}
|
|
79
|
+
testID="get-commons-button"
|
|
80
|
+
>
|
|
81
|
+
{t('accountSwitcher.getCommons')}
|
|
82
|
+
</Button>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The one primary visual for the request's current state.
|
|
88
|
+
*
|
|
89
|
+
* Ordered most-terminal-first, so a late-arriving route can never pull the
|
|
90
|
+
* surface back from "confirming" to a QR the user has already scanned. Every
|
|
91
|
+
* branch reads only controller facts — there is no local timeline.
|
|
92
|
+
*/
|
|
93
|
+
export const RequestPrimarySurface: React.FC<{
|
|
94
|
+
signIn: SignInFlowState;
|
|
95
|
+
theme: Theme;
|
|
96
|
+
t: Translate;
|
|
97
|
+
}> = ({ signIn, theme, t }) => {
|
|
98
|
+
if (signIn.progress === 'identity-confirmed') {
|
|
99
|
+
return <RouteGlyph name="check-circle" color={theme.colors.success} />;
|
|
100
|
+
}
|
|
101
|
+
if (signIn.progress === 'confirming-identity') {
|
|
102
|
+
return <PreparingSurface />;
|
|
103
|
+
}
|
|
104
|
+
if (signIn.route === 'qr' && signIn.qrPayload) {
|
|
105
|
+
return <QrPlate payload={signIn.qrPayload} theme={theme} t={t} />;
|
|
106
|
+
}
|
|
107
|
+
if (signIn.route === 'await-push') {
|
|
108
|
+
return <RouteGlyph name="cellphone-message" color={theme.colors.primary} />;
|
|
109
|
+
}
|
|
110
|
+
if (signIn.route === 'open-commons') {
|
|
111
|
+
return <RouteGlyph name="open-in-app" color={theme.colors.primary} />;
|
|
112
|
+
}
|
|
113
|
+
// No route resolved yet (or a route with no payload to render): the request is
|
|
114
|
+
// being prepared. Honest, and the only state that is not route-specific.
|
|
115
|
+
return <PreparingSurface />;
|
|
116
|
+
};
|