@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
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Shared styles for `OxyAuthChooser`'s views. Extracted from `OxyAccountDialogScreen`
|
|
3
3
|
* so both the Dialog-wrapped host and any bare host (e.g. a future
|
|
4
4
|
* auth.oxy.so hub page) render identically without duplicating a StyleSheet.
|
|
5
|
+
*
|
|
6
|
+
* Only what NativeWind cannot express lives here: the animated collapse, the
|
|
7
|
+
* fixed-contrast QR plate, per-account accent rings, and the small subordinate
|
|
8
|
+
* text-link rhythm every view's fallback affordances share.
|
|
5
9
|
*/
|
|
6
10
|
export declare const authChooserStyles: {
|
|
7
11
|
rows: {
|
|
@@ -187,5 +191,19 @@ export declare const authChooserStyles: {
|
|
|
187
191
|
borderRadius: number;
|
|
188
192
|
backgroundColor: string;
|
|
189
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* The revealed "Having trouble?" alternatives — a tight stack of subordinate
|
|
196
|
+
* text links. They share `footerLink`'s rhythm, so the stack itself only has
|
|
197
|
+
* to stop them drifting apart.
|
|
198
|
+
*/
|
|
199
|
+
troubleActions: {
|
|
200
|
+
width: "100%";
|
|
201
|
+
alignItems: "center";
|
|
202
|
+
};
|
|
203
|
+
/** The disclosure trigger, aligned with the subordinate links it reveals. */
|
|
204
|
+
troubleTrigger: {
|
|
205
|
+
alignSelf: "center";
|
|
206
|
+
marginTop: number;
|
|
207
|
+
};
|
|
190
208
|
};
|
|
191
|
-
//# sourceMappingURL=
|
|
209
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/styles.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC5B;;;;;OAKG;;;;;;;IAOH;;;;;;OAMG;;;;;;;IAOH;;;;;OAKG;;;;;;;;;;IAUH;;;;OAIG;;;;IAIH,0EAA0E;;;;;;;;;;IAU1E;qFACiF;;;;;;;;;;IAUjF,8EAA8E;;;;;IAK9E;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyEH;;;;OAIG;;;;;IAKH,6EAA6E;;;;;CAK7E,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types + per-account color resolution for the auth chooser's views.
|
|
3
|
+
*
|
|
4
|
+
* One responsibility: the vocabulary every view module in this folder speaks
|
|
5
|
+
* (theme/translate aliases, the container-supplied action bundles, and the
|
|
6
|
+
* account accent). No JSX, no state, no I/O — so a view can import it without
|
|
7
|
+
* dragging any other view in.
|
|
8
|
+
*/
|
|
9
|
+
import { type AppColorName, type useTheme } from '@oxyhq/bloom/theme';
|
|
10
|
+
import type { useI18n } from '../../hooks/useI18n';
|
|
11
|
+
export type Theme = ReturnType<typeof useTheme>;
|
|
12
|
+
export type Translate = ReturnType<typeof useI18n>['t'];
|
|
13
|
+
/** The account-row actions the container wires for the switcher + menu views. */
|
|
14
|
+
export interface OxyAuthChooserHandlers {
|
|
15
|
+
onSwitch: (accountId: string) => void;
|
|
16
|
+
onAdd: () => void;
|
|
17
|
+
onManage: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Change the current account's photo — opens the avatar-change flow. Because
|
|
20
|
+
* the account menu lives in the AccountDialog surface, this MORPHS that surface
|
|
21
|
+
* into `ChangeAvatar` (via `openAvatarPicker` → `openWithinOrPresent`), the same
|
|
22
|
+
* flow ManageAccount's avatar uses; it never stacks a new dialog.
|
|
23
|
+
*/
|
|
24
|
+
onEditAvatar: () => void;
|
|
25
|
+
}
|
|
26
|
+
/** Used/total storage bytes for the "Oxy storage" block, or `null` when unknown. */
|
|
27
|
+
export interface AccountStorageModel {
|
|
28
|
+
usedBytes: number;
|
|
29
|
+
limitBytes: number;
|
|
30
|
+
}
|
|
31
|
+
/** The account-menu row actions the container wires (deep-links / sheets / sign-out). */
|
|
32
|
+
export interface AccountsMenuActions {
|
|
33
|
+
onOpenSettings: () => void;
|
|
34
|
+
onOpenData: () => void;
|
|
35
|
+
onManageStorage: () => void;
|
|
36
|
+
onUpgradeStorage: () => void;
|
|
37
|
+
onHelp: () => void;
|
|
38
|
+
onPrivacy: () => void;
|
|
39
|
+
onTerms: () => void;
|
|
40
|
+
onSignOut: () => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Where a WebAuthn ceremony can run from the current origin.
|
|
44
|
+
*
|
|
45
|
+
* A credential minted for `oxy.so` can only be ASSERTED there (or a loopback
|
|
46
|
+
* dev host) — a hard, browser-enforced RP-ID boundary, not feature detection.
|
|
47
|
+
* `'direct'` = a first-party Oxy web origin, the ceremony runs here.
|
|
48
|
+
* `'hub'` = any other web origin; it runs in the auth.oxy.so popup instead.
|
|
49
|
+
* `'none'` = native, where Commons owns identity.
|
|
50
|
+
*/
|
|
51
|
+
export type PasskeyMode = 'direct' | 'hub' | 'none';
|
|
52
|
+
/**
|
|
53
|
+
* Everything that is NOT the sign-in surface's one primary action.
|
|
54
|
+
*
|
|
55
|
+
* The container wires these once; each view decides which of them are genuine
|
|
56
|
+
* alternatives to ITS primary surface and hands those to `TroubleDisclosure`
|
|
57
|
+
* (issue #691: fallbacks stay hidden until the user asks or the primary route
|
|
58
|
+
* fails). A view never renders one of these as a button.
|
|
59
|
+
*/
|
|
60
|
+
export interface SignInAlternatives {
|
|
61
|
+
/** Whether a WebAuthn ceremony is reachable from this origin at all. */
|
|
62
|
+
passkeyAvailable: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* `true` while a DIRECT ceremony is in flight. The hub-popup variant reports
|
|
65
|
+
* its progress through `snapshot.signIn` instead, so it never sets this.
|
|
66
|
+
*/
|
|
67
|
+
passkeyPending: boolean;
|
|
68
|
+
onSignInWithPasskey: () => void;
|
|
69
|
+
/** Fall back to the cross-device QR handoff (restarts the request). */
|
|
70
|
+
onShowQr: () => void;
|
|
71
|
+
/** Open the Commons store listing / landing page for this platform. */
|
|
72
|
+
onGetCommons: () => void;
|
|
73
|
+
/** Enter the account-creation view. */
|
|
74
|
+
onCreateAccount: () => void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Resolve an account's stored color (a named Bloom preset, e.g. `'purple'`) to
|
|
78
|
+
* a concrete brand hex for the row accent. Falls back to the theme primary when
|
|
79
|
+
* the account has no color or the value is not a recognized preset, so the accent
|
|
80
|
+
* renders in EVERY consumer regardless of NativeWind availability.
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveAccentHex(color: string | null, fallback: string): string;
|
|
83
|
+
/** Narrow a stored color string to a known `AppColorName`, or `undefined`. */
|
|
84
|
+
export declare function toPreset(color: string | null): AppColorName | undefined;
|
|
85
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsC,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC1G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;AAExD,iFAAiF;AACjF,MAAM,WAAW,sBAAsB;IACrC,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,GAAG,IAAI,GAAG,YAAY,GAAG,SAAS,CAKvE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debounced username-availability check over the existing SDK method.
|
|
3
|
+
*
|
|
4
|
+
* One responsibility: turn keystrokes into an `idle | checking | available |
|
|
5
|
+
* taken` verdict without racing. A sequence guard drops superseded responses,
|
|
6
|
+
* and a NETWORK failure resets the (now stale) verdict and toasts — it never
|
|
7
|
+
* paints an inline error inside the dialog (owner mandate).
|
|
8
|
+
*/
|
|
9
|
+
import type { OxyServices } from '@oxyhq/core';
|
|
10
|
+
import type { Translate } from './types';
|
|
11
|
+
export type UsernameStatus = 'idle' | 'checking' | 'available' | 'taken';
|
|
12
|
+
export declare function useUsernameAvailability(oxyServices: OxyServices, t: Translate): {
|
|
13
|
+
status: UsernameStatus;
|
|
14
|
+
check: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useUsernameAvailability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUsernameAvailability.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/useUsernameAvailability.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;AAOzE,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,CAAC,EAAE,SAAS,GACX;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAgCA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2E/B,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EAExB,MAAM,mBAAmB,CAAC;AAY3B,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAIlF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAkuCzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAAc,CAAC;AAsE9C,eAAO,MAAM,MAAM,QAAO,eAMzB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { User } from '@oxyhq/core';
|
|
2
|
+
import type { WebAuthMode } from '../oauth/types';
|
|
2
3
|
export interface CommitDeviceSetAndResolveDeps {
|
|
3
4
|
/**
|
|
4
5
|
* Whether this commit is a deliberate sign-in on THIS device (activates the
|
|
@@ -36,4 +37,43 @@ export interface CommitDeviceSetAndResolveDeps {
|
|
|
36
37
|
* a DETACHED background task a moment later.
|
|
37
38
|
*/
|
|
38
39
|
export declare function commitDeviceSetAndResolve(deps: CommitDeviceSetAndResolveDeps): Promise<void>;
|
|
40
|
+
export interface MaybeSyncHubAfterCommitDeps {
|
|
41
|
+
/** Deliberate sign-in (`true`) vs. a cold-boot / background commit (`false`). */
|
|
42
|
+
activate: boolean;
|
|
43
|
+
/** Per-commit opt-in — `commitSession`'s `options.hubSync`. */
|
|
44
|
+
hubSyncRequested: boolean;
|
|
45
|
+
/** Provider-level opt-out — `OxyProviderProps.hubSync`. */
|
|
46
|
+
hubSyncEnabled: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The provider's web sign-in transport — `OxyProviderProps.webAuthMode`.
|
|
49
|
+
* A first-class input: `'popup'` forbids the redirect outright.
|
|
50
|
+
*/
|
|
51
|
+
webAuthMode: WebAuthMode;
|
|
52
|
+
/**
|
|
53
|
+
* Starts the full-page hop to `auth.oxy.so/sync`; resolves `true` when the
|
|
54
|
+
* navigation was actually started.
|
|
55
|
+
*/
|
|
56
|
+
syncHub: () => Promise<boolean>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Post-sign-in hub sync: plant this device's credential on the IdP hub so OTHER
|
|
60
|
+
* official origins can silently restore a session on their next cold boot.
|
|
61
|
+
*
|
|
62
|
+
* The tail of the ONE commit funnel (`commitSession`), extracted so every gate
|
|
63
|
+
* on this legacy lane lives — and is tested — in one place. Returns whether the
|
|
64
|
+
* full-page redirect was started; a failure is non-fatal and never propagates
|
|
65
|
+
* (the sign-in itself already succeeded).
|
|
66
|
+
*
|
|
67
|
+
* Four gates, all of which must pass:
|
|
68
|
+
* 1. `activate` — only a deliberate sign-in syncs; a cold-boot restore never does.
|
|
69
|
+
* 2. `hubSyncRequested` — the in-place lanes (account switch, popup OAuth) opt out.
|
|
70
|
+
* 3. `hubSyncEnabled` — the provider-level `hubSync` prop.
|
|
71
|
+
* 4. `allowsAutomaticIdpRedirect(webAuthMode)` — hub sync REPLACES the document
|
|
72
|
+
* with `auth.oxy.so`, so `webAuthMode: 'popup'` forbids it: a redirect that
|
|
73
|
+
* bounces the tab defeats the entire point of the mode, no matter which
|
|
74
|
+
* commit path produced the session (issue #691, "Cold boot and cross-domain
|
|
75
|
+
* behavior"). Redirect mode — the default and the compatibility path — is
|
|
76
|
+
* unchanged, and this whole function disappears with it in phase 7b.
|
|
77
|
+
*/
|
|
78
|
+
export declare function maybeSyncHubAfterCommit(deps: MaybeSyncHubAfterCommitDeps): Promise<boolean>;
|
|
39
79
|
//# sourceMappingURL=commitSessionFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitSessionFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/commitSessionFlow.ts"],"names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+D;IAC/D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,OAAO,CAAC,CAelB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiError, AuthStateStore, SessionClient, User } from '@oxyhq/core';
|
|
1
|
+
import type { ApiError, AuthStateStore, IdentityBinding, SessionClient, User } from '@oxyhq/core';
|
|
2
2
|
import type { AuthState } from '../../stores/authStore';
|
|
3
3
|
import type { ClientSession } from '@oxyhq/core';
|
|
4
4
|
import type { StorageInterface } from '../../utils/storageHelpers';
|
|
@@ -39,6 +39,15 @@ export interface UseAuthOperationsOptions {
|
|
|
39
39
|
logoutStore: () => void;
|
|
40
40
|
setAuthState: (state: Partial<AuthState>) => void;
|
|
41
41
|
logger?: (message: string, error?: unknown) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Identity-bound session (`sessionMode: 'identity'`). When set, a successful
|
|
44
|
+
* key sign-in writes the durable `{publicKey, accountId}` pin so pinned
|
|
45
|
+
* re-mints and projections bind immediately instead of waiting for a second
|
|
46
|
+
* `establishIdentitySession` round-trip.
|
|
47
|
+
*/
|
|
48
|
+
identityBinding?: IdentityBinding;
|
|
49
|
+
/** Refreshes the provider's memoised pinned account id after the pin lands. */
|
|
50
|
+
refreshPinnedAccountId?: () => Promise<string | null>;
|
|
42
51
|
}
|
|
43
52
|
export interface UseAuthOperationsResult {
|
|
44
53
|
/** Sign in with existing public key */
|
|
@@ -61,5 +70,5 @@ export declare function clearPersistedAuthSafe(store: AuthStateStore, logger?: (
|
|
|
61
70
|
* Authentication operations using public key cryptography.
|
|
62
71
|
* Accepts public key as parameter - identity management is handled by the app layer.
|
|
63
72
|
*/
|
|
64
|
-
export declare const useAuthOperations: ({ oxyServices, store, activeSessionId, setActiveSessionId, updateSessions, saveActiveSessionId, clearSessionState, switchSession, sessionClient, syncFromClient, onAuthStateChange, onError, loginSuccess, loginFailure, logoutStore, setAuthState, logger, }: UseAuthOperationsOptions) => UseAuthOperationsResult;
|
|
73
|
+
export declare const useAuthOperations: ({ oxyServices, store, activeSessionId, setActiveSessionId, updateSessions, saveActiveSessionId, clearSessionState, switchSession, sessionClient, syncFromClient, onAuthStateChange, onError, loginSuccess, loginFailure, logoutStore, setAuthState, logger, identityBinding, refreshPinnedAccountId, }: UseAuthOperationsOptions) => UseAuthOperationsResult;
|
|
65
74
|
//# sourceMappingURL=useAuthOperations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuthOperations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useAuthOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useAuthOperations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useAuthOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,aAAa,CAAC;AAIvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,gBAAgB,GAA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E,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,uBAAuB;IACtC,uCAAuC;IACvC,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,kCAAkC;IAClC,MAAM,EAAE,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,+BAA+B;IAC/B,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAMD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,EACrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,GAClD,IAAI,CAIN;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,wSAoB/B,wBAAwB,KAAG,uBAmS7B,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { OxyServices, User, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView, ApiError, SessionClient } from '@oxyhq/core';
|
|
2
|
+
import type { OxyServices, User, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView, ApiError, SessionClient, SessionMode } from '@oxyhq/core';
|
|
3
3
|
import type { UseFollowHook } from '../hooks/useFollow.types';
|
|
4
4
|
import type { useLanguageManagement } from '../hooks/useLanguageManagement';
|
|
5
5
|
import type { RouteName } from '../navigation/routes';
|
|
6
|
+
import type { StartWebOAuthSignInOptions } from '../oauth/browserAuthTransport';
|
|
7
|
+
import type { WebAuthMode, WebOAuthSignInResult } from '../oauth/types';
|
|
6
8
|
export interface OxyContextState {
|
|
7
9
|
user: User | null;
|
|
8
10
|
sessions: ClientSession[];
|
|
@@ -25,6 +27,19 @@ export interface OxyContextState {
|
|
|
25
27
|
*/
|
|
26
28
|
isAuthResolved: boolean;
|
|
27
29
|
isStorageReady: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Who owns this provider's session (see `OxyProviderProps.sessionMode`).
|
|
32
|
+
*
|
|
33
|
+
* `'account'` — the device's active account; any app on the device can switch
|
|
34
|
+
* it and this client follows. `'identity'` — the owner of the local primary
|
|
35
|
+
* identity key, permanently: a sibling app's account switch never changes this
|
|
36
|
+
* client's user or bearer, and every account-graph mutation
|
|
37
|
+
* (`switchToAccount` / `switchSession`) rejects with `IdentityBoundSessionError`
|
|
38
|
+
* while `accounts` stays empty and the account dialog never opens.
|
|
39
|
+
*/
|
|
40
|
+
sessionMode: SessionMode;
|
|
41
|
+
/** How web third-party sign-in reaches the IdP (see `OxyProviderProps.webAuthMode`). */
|
|
42
|
+
webAuthMode: WebAuthMode;
|
|
28
43
|
error: string | null;
|
|
29
44
|
/** Active UI locale (`language-REGION`): the account's primary locale when signed in, else the guest/device locale. */
|
|
30
45
|
currentLanguage: string;
|
|
@@ -75,6 +90,23 @@ export interface OxyContextState {
|
|
|
75
90
|
removePasskey: (credentialId: string) => Promise<void>;
|
|
76
91
|
revokeSuspiciousSignIn: () => Promise<void>;
|
|
77
92
|
handleWebSession: (session: SessionLoginResponse) => Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Run a WEB third-party OAuth sign-in (authorization code + PKCE) end to end
|
|
95
|
+
* using this provider's `webAuthMode`, and commit the resulting session.
|
|
96
|
+
*
|
|
97
|
+
* This is the shared operation `OxySignInButton` delegates to; RPs that ship
|
|
98
|
+
* their own button call it directly and never implement popup listeners, a
|
|
99
|
+
* token exchange, or `state` validation themselves. Returns a typed result —
|
|
100
|
+
* closing the popup and running out of time are values, not exceptions.
|
|
101
|
+
*
|
|
102
|
+
* In popup mode the window MUST be opened during the user's click: either
|
|
103
|
+
* call this synchronously from the press handler (it opens one itself), or
|
|
104
|
+
* call `openOAuthPopup()` there and pass the handle as `popup`.
|
|
105
|
+
*
|
|
106
|
+
* No-op outside a browser and in `sessionMode: 'identity'`, both of which
|
|
107
|
+
* resolve to `{ status: 'unsupported' }`.
|
|
108
|
+
*/
|
|
109
|
+
startWebOAuthSignIn: (options: StartWebOAuthSignInOptions) => Promise<WebOAuthSignInResult>;
|
|
78
110
|
logout: (targetSessionId?: string) => Promise<void>;
|
|
79
111
|
logoutAll: () => Promise<void>;
|
|
80
112
|
switchSession: (sessionId: string) => Promise<User>;
|
|
@@ -127,6 +159,17 @@ export interface OxyContextProviderProps {
|
|
|
127
159
|
authorizeBaseUrl?: string;
|
|
128
160
|
storageKeyPrefix?: string;
|
|
129
161
|
clientId?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Who owns this provider's session. See `OxyProviderProps.sessionMode` for the
|
|
164
|
+
* full contract.
|
|
165
|
+
* @default 'account'
|
|
166
|
+
*/
|
|
167
|
+
sessionMode?: SessionMode;
|
|
168
|
+
/**
|
|
169
|
+
* Transport for WEB third-party sign-in. See `OxyProviderProps.webAuthMode`.
|
|
170
|
+
* @default 'redirect'
|
|
171
|
+
*/
|
|
172
|
+
webAuthMode?: WebAuthMode;
|
|
130
173
|
/** Sync device credentials to auth.oxy.so after interactive sign-in. @default true */
|
|
131
174
|
hubSync?: boolean;
|
|
132
175
|
onAuthStateChange?: (user: User | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxyContextTypes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/oxyContextTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"oxyContext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AAC;CACrC;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D"}
|
|
@@ -6,6 +6,12 @@ interface UseOxyAccountGraphParams {
|
|
|
6
6
|
isAuthenticated: boolean;
|
|
7
7
|
tokenReady: boolean;
|
|
8
8
|
initialized: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* `sessionMode: 'identity'`. The account graph is a switcher surface, and an
|
|
11
|
+
* identity-bound client authenticates as the owner of the local identity key —
|
|
12
|
+
* permanently. The graph is therefore never fetched and every switch rejects.
|
|
13
|
+
*/
|
|
14
|
+
identityBound: boolean;
|
|
9
15
|
oxyServices: OxyServices;
|
|
10
16
|
sessionClient: SessionClient;
|
|
11
17
|
syncFromClient: () => Promise<void>;
|
|
@@ -17,7 +23,7 @@ interface UseOxyAccountGraphParams {
|
|
|
17
23
|
accountDialogControllerRef: RefObject<AccountDialogController | null>;
|
|
18
24
|
clearSessionStateRef: RefObject<() => Promise<void>>;
|
|
19
25
|
}
|
|
20
|
-
export declare function useOxyAccountGraph({ isAuthenticated, tokenReady, initialized, oxyServices, sessionClient, syncFromClient, commitSession, queryClient, accountDialogControllerRef, clearSessionStateRef, }: UseOxyAccountGraphParams): {
|
|
26
|
+
export declare function useOxyAccountGraph({ isAuthenticated, tokenReady, initialized, identityBound, oxyServices, sessionClient, syncFromClient, commitSession, queryClient, accountDialogControllerRef, clearSessionStateRef, }: UseOxyAccountGraphParams): {
|
|
21
27
|
accounts: AccountNode[];
|
|
22
28
|
refreshAccounts: () => Promise<void>;
|
|
23
29
|
switchToAccount: (accountId: string) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOxyAccountGraph.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/useOxyAccountGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useOxyAccountGraph.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/useOxyAccountGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOxH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,UAAU,wBAAwB;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,aAAa,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxG,WAAW,EAAE,WAAW,CAAC;IACzB,0BAA0B,EAAE,SAAS,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;IACtE,oBAAoB,EAAE,SAAS,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CACtD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,GACrB,EAAE,wBAAwB;;2BAGqB,OAAO,CAAC,IAAI,CAAC;iCAsCvC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;0BAuC3B,kBAAkB,KAAG,OAAO,CAAC,WAAW,CAAC;EAczD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwitchableAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSwitchableAccounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,2BAA2B;IACxC,0EAA0E;IAC1E,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"useSwitchableAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSwitchableAccounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,2BAA2B;IACxC,0EAA0E;IAC1E,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AA4BD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,IAAI,2BAA2B,CAuBnE"}
|
|
@@ -21,7 +21,6 @@ export { RequireOxyAuth } from './components/RequireOxyAuth';
|
|
|
21
21
|
export type { RequireOxyAuthProps, RequireOxyAuthPrompt } from './components/RequireOxyAuth';
|
|
22
22
|
export { default as FollowButton } from './components/FollowButton';
|
|
23
23
|
export { default as OxyPayButton } from './components/OxyPayButton';
|
|
24
|
-
export { FontLoader, setupFonts } from './components/FontLoader';
|
|
25
24
|
export { default as ProfileButton } from './components/ProfileButton';
|
|
26
25
|
export { useOxy } from './context/OxyContext';
|
|
27
26
|
export { useAuth } from './hooks/useAuth';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceR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I,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGnF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single web entry point for third-party "Sign in with Oxy".
|
|
3
|
+
*
|
|
4
|
+
* Picks the transport (`popup` or `redirect`), drives it, and returns ONE typed
|
|
5
|
+
* result — so callers (`OxySignInButton`, and any RP with its own button) never
|
|
6
|
+
* touch `window.open`, `postMessage`, or the token exchange themselves.
|
|
7
|
+
*
|
|
8
|
+
* Popup mode keeps the relying party mounted: its route, scroll position, and
|
|
9
|
+
* unsaved state survive because the tab never navigates. Redirect mode is the
|
|
10
|
+
* compatibility fallback, and is also where popup mode lands when the browser
|
|
11
|
+
* blocks the window — a blocked popup must still sign the user in, not dead-end.
|
|
12
|
+
*
|
|
13
|
+
* Native is NOT handled here: `openAuthorizeUrlNative` (an in-app auth session)
|
|
14
|
+
* remains the native lane and is untouched by this module.
|
|
15
|
+
*/
|
|
16
|
+
import type { OxyServices } from '@oxyhq/core';
|
|
17
|
+
import type { OAuthPopupHandle, OAuthSessionCommitInput, WebAuthMode, WebOAuthSignInResult } from './types';
|
|
18
|
+
/** Provider-owned wiring for a web sign-in — everything that is not per-press. */
|
|
19
|
+
export interface WebOAuthTransportContext {
|
|
20
|
+
/** The provider's `webAuthMode`. */
|
|
21
|
+
mode: WebAuthMode;
|
|
22
|
+
oxyServices: OxyServices;
|
|
23
|
+
/** The app's registered client id; `null` disables third-party sign-in. */
|
|
24
|
+
clientId: string | null;
|
|
25
|
+
/** Authorize endpoint override (local/staging deployments). */
|
|
26
|
+
authorizeBaseUrl?: string;
|
|
27
|
+
/** `sessionMode: 'identity'` — no third-party OAuth lane exists by design. */
|
|
28
|
+
identityBound: boolean;
|
|
29
|
+
/** The provider's session commit funnel. */
|
|
30
|
+
commitSession: (input: OAuthSessionCommitInput) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/** Per-press inputs for {@link startWebOAuthSignIn}. */
|
|
33
|
+
export interface StartWebOAuthSignInOptions {
|
|
34
|
+
/** EXACT registered redirect URI for this application. */
|
|
35
|
+
redirectUri: string;
|
|
36
|
+
/**
|
|
37
|
+
* The popup to drive, when the caller already opened one.
|
|
38
|
+
*
|
|
39
|
+
* - omitted — this call opens the window itself, which is only valid when it
|
|
40
|
+
* was invoked SYNCHRONOUSLY from the user's click (gesture attribution);
|
|
41
|
+
* - `null` — the caller tried and the browser blocked it: fall back to a
|
|
42
|
+
* full-page redirect;
|
|
43
|
+
* - a handle — use exactly this window.
|
|
44
|
+
*
|
|
45
|
+
* Callers that must `await` before signing in (resolving the application, for
|
|
46
|
+
* instance) have to open the window in their press handler and pass it here;
|
|
47
|
+
* a window opened after an `await` is silently blocked by every browser.
|
|
48
|
+
*/
|
|
49
|
+
popup?: OAuthPopupHandle | null;
|
|
50
|
+
/** Requested scope; defaults to the SDK's standard sign-in scope. */
|
|
51
|
+
scope?: string;
|
|
52
|
+
/** Popup timeout override (ms). */
|
|
53
|
+
timeoutMs?: number;
|
|
54
|
+
}
|
|
55
|
+
export declare function startWebOAuthSignIn(context: WebOAuthTransportContext, options: StartWebOAuthSignInOptions): Promise<WebOAuthSignInResult>;
|
|
56
|
+
//# sourceMappingURL=browserAuthTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserAuthTransport.d.ts","sourceRoot":"","sources":["../../../../../src/ui/oauth/browserAuthTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EAEX,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,kFAAkF;AAClF,MAAM,WAAW,wBAAwB;IACvC,oCAAoC;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,aAAa,EAAE,OAAO,CAAC;IACvB,4CAA4C;IAC5C,aAAa,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,wDAAwD;AACxD,MAAM,WAAW,0BAA0B;IACzC,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAsF/B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE path from an OAuth authorization code to a committed session.
|
|
3
|
+
*
|
|
4
|
+
* Both web transports end here — the popup with an in-memory handshake, the
|
|
5
|
+
* redirect lane with one read back from `sessionStorage` — so state validation,
|
|
6
|
+
* the PKCE exchange, the session commit, and handshake cleanup exist exactly
|
|
7
|
+
* once. Duplicating any of those per transport is how the two lanes would drift
|
|
8
|
+
* apart on the security-critical steps.
|
|
9
|
+
*
|
|
10
|
+
* Ordering is deliberate and load-bearing:
|
|
11
|
+
* 1. validate `state` BEFORE anything is sent to the token endpoint,
|
|
12
|
+
* 2. exchange the code for a session,
|
|
13
|
+
* 3. run `cleanup` (drop the persisted handshake / strip `?code=` from the
|
|
14
|
+
* URL) BEFORE the commit, so a stale code can never re-enter the exchange,
|
|
15
|
+
* 4. commit the session.
|
|
16
|
+
*
|
|
17
|
+
* `cleanup` runs exactly once on EVERY exit path, including a state mismatch
|
|
18
|
+
* and a failed exchange.
|
|
19
|
+
*/
|
|
20
|
+
import type { OxyServices } from '@oxyhq/core';
|
|
21
|
+
import type { OAuthCompletionResult, OAuthHandshake, OAuthSessionCommitInput } from './types';
|
|
22
|
+
/** Inputs for {@link completeOAuthCode}. */
|
|
23
|
+
export interface CompleteOAuthCodeInput {
|
|
24
|
+
oxyServices: OxyServices;
|
|
25
|
+
/** The registered `ApplicationCredential` public key (`oxy_dk_…`). */
|
|
26
|
+
clientId: string;
|
|
27
|
+
/** The single-use authorization code the IdP issued. */
|
|
28
|
+
code: string;
|
|
29
|
+
/** The `state` the IdP returned, or `null` when it sent none. */
|
|
30
|
+
returnedState: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The handshake this RP started the authorize request with, or `null` when it
|
|
33
|
+
* is gone (never stored, expired, or a different tab's). A missing handshake
|
|
34
|
+
* is treated exactly like a mismatched `state`: no exchange is attempted.
|
|
35
|
+
*/
|
|
36
|
+
handshake: OAuthHandshake | null;
|
|
37
|
+
/** EXACT redirect URI sent on the authorize request — OAuth requires a match. */
|
|
38
|
+
redirectUri: string;
|
|
39
|
+
/** The provider's session commit funnel. */
|
|
40
|
+
commitSession: (input: OAuthSessionCommitInput) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Transport-specific teardown, invoked once after the exchange settles and
|
|
43
|
+
* before the commit. The redirect lane strips `?code=` and clears the
|
|
44
|
+
* persisted handshake; the popup lane has nothing persisted and omits it.
|
|
45
|
+
*/
|
|
46
|
+
cleanup?: () => void;
|
|
47
|
+
}
|
|
48
|
+
export declare function completeOAuthCode(input: CompleteOAuthCodeInput): Promise<OAuthCompletionResult>;
|
|
49
|
+
//# sourceMappingURL=completeOAuthCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completeOAuthCode.d.ts","sourceRoot":"","sources":["../../../../../src/ui/oauth/completeOAuthCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAE9F,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,WAAW,CAAC;IACzB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,aAAa,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAuChC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The legacy, redirect-mode-only lanes that navigate the RP's TOP-LEVEL window
|
|
3
|
+
* to the IdP without a user gesture.
|
|
4
|
+
*
|
|
5
|
+
* `webAuthMode: 'popup'` exists to guarantee exactly one thing: the relying
|
|
6
|
+
* party never leaves its route. Two mechanics in this SDK break that guarantee,
|
|
7
|
+
* because each replaces the whole document on its own initiative:
|
|
8
|
+
*
|
|
9
|
+
* 1. **Cold-boot silent restore** — a full-page `prompt=none` authorize bounce
|
|
10
|
+
* to `auth.oxy.so` when the device-secret mint finds no local session
|
|
11
|
+
* (`maybeStartSilentOAuthRestore`, called from `runProviderColdBoot`).
|
|
12
|
+
* 2. **Post-sign-in hub sync** — a full-page hop to `auth.oxy.so/sync` that
|
|
13
|
+
* plants this device's credential on the IdP hub so OTHER origins can later
|
|
14
|
+
* run lane 1 (`syncHubAfterSignIn`, called from the `commitSession` funnel).
|
|
15
|
+
*
|
|
16
|
+
* Both belong to the redirect transport and are kept only for the migration
|
|
17
|
+
* window (issue #691, "Cold boot and cross-domain behavior"). In popup mode a
|
|
18
|
+
* domain with no local credential simply resolves SIGNED OUT, and the user's
|
|
19
|
+
* next explicit "Continue with Oxy" opens the popup — from a real user gesture,
|
|
20
|
+
* never automatically.
|
|
21
|
+
*
|
|
22
|
+
* NOT covered here, and correctly enabled in BOTH modes: navigations the user
|
|
23
|
+
* asked for. When the browser blocks the popup, `startWebOAuthSignIn` still
|
|
24
|
+
* falls back to a full-page redirect rather than dead-ending the sign-in, and
|
|
25
|
+
* `tryCompleteOAuthReturn` still consumes a `?code=` that is already on the URL.
|
|
26
|
+
*
|
|
27
|
+
* PHASE 7b: once the pilot flips the default transport to `'popup'`, this
|
|
28
|
+
* predicate and BOTH lanes above are deleted outright. Grepping this symbol
|
|
29
|
+
* finds every site that has to go.
|
|
30
|
+
*/
|
|
31
|
+
import type { WebAuthMode } from './types';
|
|
32
|
+
/**
|
|
33
|
+
* Whether a provider running `webAuthMode` may perform an SDK-initiated,
|
|
34
|
+
* non-gesture, full-page navigation to the IdP.
|
|
35
|
+
*
|
|
36
|
+
* `true` only for `'redirect'` — still the default and the compatibility path,
|
|
37
|
+
* whose behaviour must stay byte-for-byte unchanged.
|
|
38
|
+
*/
|
|
39
|
+
export declare function allowsAutomaticIdpRedirect(webAuthMode: WebAuthMode): boolean;
|
|
40
|
+
//# sourceMappingURL=legacyRedirectLanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacyRedirectLanes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/oauth/legacyRedirectLanes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The RP half of an OAuth authorize request: a fresh CSRF `state` + PKCE pair,
|
|
3
|
+
* and the authorize URL built from them.
|
|
4
|
+
*
|
|
5
|
+
* Both web transports start here, and the ONLY difference between them is one
|
|
6
|
+
* parameter: `popup` asks the IdP for `response_mode=web_message` so the result
|
|
7
|
+
* comes back to `window.opener` instead of navigating the RP's tab. Everything
|
|
8
|
+
* else — `S256` PKCE, exact registered `redirect_uri`, random `state` — is
|
|
9
|
+
* identical, which is what lets both lanes converge on one completion path.
|
|
10
|
+
*/
|
|
11
|
+
import type { OAuthHandshake } from './types';
|
|
12
|
+
/** Inputs for {@link prepareAuthorizeRequest}. */
|
|
13
|
+
export interface PrepareAuthorizeRequestParams {
|
|
14
|
+
/** The registered `ApplicationCredential` public key (`oxy_dk_…`). */
|
|
15
|
+
clientId: string;
|
|
16
|
+
/** EXACT registered redirect URI. The token exchange must replay this value. */
|
|
17
|
+
redirectUri: string;
|
|
18
|
+
/** Authorize endpoint override; defaults to the production Oxy IdP. */
|
|
19
|
+
authorizeBaseUrl?: string;
|
|
20
|
+
/** Requested scope; defaults to the SDK's standard sign-in scope. */
|
|
21
|
+
scope?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Ask the IdP to deliver the result to `window.opener` via `postMessage`
|
|
24
|
+
* instead of redirecting. Set ONLY by the popup transport. It is a request,
|
|
25
|
+
* not a guarantee — an IdP with no opener still redirects.
|
|
26
|
+
*/
|
|
27
|
+
responseMode?: 'web_message';
|
|
28
|
+
}
|
|
29
|
+
/** A ready-to-use authorize request plus the secrets that finish it. */
|
|
30
|
+
export interface PreparedAuthorizeRequest {
|
|
31
|
+
/** Fully-built `auth.oxy.so/authorize` URL. */
|
|
32
|
+
authorizeUrl: string;
|
|
33
|
+
/**
|
|
34
|
+
* Exact origin of {@link authorizeUrl}. The popup transport accepts
|
|
35
|
+
* `postMessage` from this origin and no other.
|
|
36
|
+
*/
|
|
37
|
+
authorizeOrigin: string;
|
|
38
|
+
/** The `state` + PKCE verifier this request is bound to. */
|
|
39
|
+
handshake: OAuthHandshake;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generate a fresh handshake and build the authorize URL around it.
|
|
43
|
+
*
|
|
44
|
+
* The verifier is returned to the caller and never stored here: the popup
|
|
45
|
+
* transport keeps it in memory for the lifetime of the attempt, and the
|
|
46
|
+
* redirect transport persists it through `persistOAuthHandshake` because a
|
|
47
|
+
* full-page navigation destroys the running document.
|
|
48
|
+
*/
|
|
49
|
+
export declare function prepareAuthorizeRequest(params: PrepareAuthorizeRequestParams): Promise<PreparedAuthorizeRequest>;
|
|
50
|
+
//# sourceMappingURL=oauthHandshake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthHandshake.d.ts","sourceRoot":"","sources":["../../../../../src/ui/oauth/oauthHandshake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED,wEAAwE;AACxE,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,wBAAwB,CAAC,CAkBnC"}
|