@onairos/react-native 3.1.11 → 3.1.13
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/lib/commonjs/api/index.js +75 -1
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +27 -0
- package/lib/commonjs/components/BodyText.js.map +1 -0
- package/lib/commonjs/components/BrandMark.js +44 -0
- package/lib/commonjs/components/BrandMark.js.map +1 -0
- package/lib/commonjs/components/CodeInput.js +30 -0
- package/lib/commonjs/components/CodeInput.js.map +1 -0
- package/lib/commonjs/components/EmailInput.js +30 -0
- package/lib/commonjs/components/EmailInput.js.map +1 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +474 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/commonjs/components/GoogleButton.js +55 -0
- package/lib/commonjs/components/GoogleButton.js.map +1 -0
- package/lib/commonjs/components/HeadingGroup.js +43 -0
- package/lib/commonjs/components/HeadingGroup.js.map +1 -0
- package/lib/commonjs/components/ModalHeader.js +99 -0
- package/lib/commonjs/components/ModalHeader.js.map +1 -0
- package/lib/commonjs/components/ModalSheet.js +41 -0
- package/lib/commonjs/components/ModalSheet.js.map +1 -0
- package/lib/commonjs/components/Onairos.js +1 -3
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +171 -190
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +169 -0
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -0
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PersonaImage.js +60 -0
- package/lib/commonjs/components/PersonaImage.js.map +1 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +156 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +316 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/commonjs/components/PinCreationScreen.js +393 -0
- package/lib/commonjs/components/PinCreationScreen.js.map +1 -0
- package/lib/commonjs/components/PinInput.js +282 -120
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +828 -0
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/commonjs/components/PlatformToggle.js +180 -0
- package/lib/commonjs/components/PlatformToggle.js.map +1 -0
- package/lib/commonjs/components/PrimaryButton.js +180 -0
- package/lib/commonjs/components/PrimaryButton.js.map +1 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -0
- package/lib/commonjs/components/SignInMatchAnimation.js.map +1 -0
- package/lib/commonjs/components/SignInStep.js +179 -0
- package/lib/commonjs/components/SignInStep.js.map +1 -0
- package/lib/commonjs/components/TrainingModal.js +808 -563
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +2304 -1283
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/VerificationStep.js +154 -0
- package/lib/commonjs/components/VerificationStep.js.map +1 -0
- package/lib/commonjs/components/WelcomeScreen.js +385 -0
- package/lib/commonjs/components/WelcomeScreen.js.map +1 -0
- package/lib/commonjs/components/icons/Basicproficon.js +37 -0
- package/lib/commonjs/components/icons/Basicproficon.js.map +1 -0
- package/lib/commonjs/components/icons/Basicprofile.js +21 -0
- package/lib/commonjs/components/icons/Basicprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Checkbox.js +21 -0
- package/lib/commonjs/components/icons/Checkbox.js.map +1 -0
- package/lib/commonjs/components/icons/Checkmark.js +27 -0
- package/lib/commonjs/components/icons/Checkmark.js.map +1 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -0
- package/lib/commonjs/components/icons/Contentanalysis.js.map +1 -0
- package/lib/commonjs/components/icons/Contenticon.js +39 -0
- package/lib/commonjs/components/icons/Contenticon.js.map +1 -0
- package/lib/commonjs/components/icons/EnochE.js +41 -0
- package/lib/commonjs/components/icons/EnochE.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityicon.js +30 -0
- package/lib/commonjs/components/icons/Personalityicon.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -0
- package/lib/commonjs/components/icons/Personalityprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -0
- package/lib/commonjs/components/icons/Personalitytraits.js.map +1 -0
- package/lib/commonjs/components/icons/Userpreferences.js +21 -0
- package/lib/commonjs/components/icons/Userpreferences.js.map +1 -0
- package/lib/commonjs/components/icons/index.js +84 -0
- package/lib/commonjs/components/icons/index.js.map +1 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +134 -743
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/config/api.js +34 -0
- package/lib/commonjs/config/api.js.map +1 -0
- package/lib/commonjs/context/AuthContext.js +345 -0
- package/lib/commonjs/context/AuthContext.js.map +1 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/commonjs/hooks/useConnections.js +120 -125
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +148 -0
- package/lib/commonjs/hooks/useUserConnections.js.map +1 -0
- package/lib/commonjs/index.js +149 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiClient.js +302 -0
- package/lib/commonjs/services/apiClient.js.map +1 -0
- package/lib/commonjs/services/authService.js +935 -0
- package/lib/commonjs/services/authService.js.map +1 -0
- package/lib/commonjs/services/biometricPinService.js +184 -0
- package/lib/commonjs/services/biometricPinService.js.map +1 -0
- package/lib/commonjs/services/connectedAccountsService.js +268 -0
- package/lib/commonjs/services/connectedAccountsService.js.map +1 -0
- package/lib/commonjs/services/googleAuthService.js +268 -0
- package/lib/commonjs/services/googleAuthService.js.map +1 -0
- package/lib/commonjs/services/imageCompressionService.js +260 -0
- package/lib/commonjs/services/imageCompressionService.js.map +1 -0
- package/lib/commonjs/services/jwtStorageService.js +256 -0
- package/lib/commonjs/services/jwtStorageService.js.map +1 -0
- package/lib/commonjs/services/mobileTrainingService.js +185 -0
- package/lib/commonjs/services/mobileTrainingService.js.map +1 -0
- package/lib/commonjs/services/pinEncryptionService.js +84 -0
- package/lib/commonjs/services/pinEncryptionService.js.map +1 -0
- package/lib/commonjs/services/pinStorageUtils.js +105 -0
- package/lib/commonjs/services/pinStorageUtils.js.map +1 -0
- package/lib/commonjs/services/platformAuthService.js +956 -722
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/services/storageService.js +404 -0
- package/lib/commonjs/services/storageService.js.map +1 -0
- package/lib/commonjs/services/trainingApiHelpers.js +73 -0
- package/lib/commonjs/services/trainingApiHelpers.js.map +1 -0
- package/lib/commonjs/services/userConnectionsService.js +486 -0
- package/lib/commonjs/services/userConnectionsService.js.map +1 -0
- package/lib/commonjs/services/youtubeMigrationService.js +415 -0
- package/lib/commonjs/services/youtubeMigrationService.js.map +1 -0
- package/lib/commonjs/theme/index.js +249 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/utils/eventUtils.js +288 -0
- package/lib/commonjs/utils/eventUtils.js.map +1 -0
- package/lib/commonjs/utils/haptics.js +66 -0
- package/lib/commonjs/utils/haptics.js.map +1 -0
- package/lib/commonjs/utils/imagePreloader.js +6 -0
- package/lib/commonjs/utils/imagePreloader.js.map +1 -0
- package/lib/module/api/index.js +72 -0
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +20 -0
- package/lib/module/components/BodyText.js.map +1 -0
- package/lib/module/components/BrandMark.js +37 -0
- package/lib/module/components/BrandMark.js.map +1 -0
- package/lib/module/components/CodeInput.js +23 -0
- package/lib/module/components/CodeInput.js.map +1 -0
- package/lib/module/components/EmailInput.js +23 -0
- package/lib/module/components/EmailInput.js.map +1 -0
- package/lib/module/components/ExistingUserDataConfirmation.js +465 -0
- package/lib/module/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/module/components/GoogleButton.js +48 -0
- package/lib/module/components/GoogleButton.js.map +1 -0
- package/lib/module/components/HeadingGroup.js +36 -0
- package/lib/module/components/HeadingGroup.js.map +1 -0
- package/lib/module/components/ModalHeader.js +92 -0
- package/lib/module/components/ModalHeader.js.map +1 -0
- package/lib/module/components/ModalSheet.js +34 -0
- package/lib/module/components/ModalSheet.js.map +1 -0
- package/lib/module/components/Onairos.js +1 -3
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +172 -192
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/OnairosSignInButton.js +160 -0
- package/lib/module/components/OnairosSignInButton.js.map +1 -0
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PersonaImage.js +53 -0
- package/lib/module/components/PersonaImage.js.map +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +148 -0
- package/lib/module/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +309 -0
- package/lib/module/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/module/components/PinCreationScreen.js +386 -0
- package/lib/module/components/PinCreationScreen.js.map +1 -0
- package/lib/module/components/PinInput.js +283 -120
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +820 -0
- package/lib/module/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/module/components/PlatformToggle.js +173 -0
- package/lib/module/components/PlatformToggle.js.map +1 -0
- package/lib/module/components/PrimaryButton.js +172 -0
- package/lib/module/components/PrimaryButton.js.map +1 -0
- package/lib/module/components/SignInMatchAnimation.js +189 -0
- package/lib/module/components/SignInMatchAnimation.js.map +1 -0
- package/lib/module/components/SignInStep.js +171 -0
- package/lib/module/components/SignInStep.js.map +1 -0
- package/lib/module/components/TrainingModal.js +809 -565
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +2307 -1284
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/VerificationStep.js +146 -0
- package/lib/module/components/VerificationStep.js.map +1 -0
- package/lib/module/components/WelcomeScreen.js +378 -0
- package/lib/module/components/WelcomeScreen.js.map +1 -0
- package/lib/module/components/icons/Basicproficon.js +30 -0
- package/lib/module/components/icons/Basicproficon.js.map +1 -0
- package/lib/module/components/icons/Basicprofile.js +14 -0
- package/lib/module/components/icons/Basicprofile.js.map +1 -0
- package/lib/module/components/icons/Checkbox.js +14 -0
- package/lib/module/components/icons/Checkbox.js.map +1 -0
- package/lib/module/components/icons/Checkmark.js +20 -0
- package/lib/module/components/icons/Checkmark.js.map +1 -0
- package/lib/module/components/icons/Contentanalysis.js +14 -0
- package/lib/module/components/icons/Contentanalysis.js.map +1 -0
- package/lib/module/components/icons/Contenticon.js +32 -0
- package/lib/module/components/icons/Contenticon.js.map +1 -0
- package/lib/module/components/icons/EnochE.js +34 -0
- package/lib/module/components/icons/EnochE.js.map +1 -0
- package/lib/module/components/icons/Personalityicon.js +23 -0
- package/lib/module/components/icons/Personalityicon.js.map +1 -0
- package/lib/module/components/icons/Personalityprofile.js +14 -0
- package/lib/module/components/icons/Personalityprofile.js.map +1 -0
- package/lib/module/components/icons/Personalitytraits.js +14 -0
- package/lib/module/components/icons/Personalitytraits.js.map +1 -0
- package/lib/module/components/icons/Userpreferences.js +14 -0
- package/lib/module/components/icons/Userpreferences.js.map +1 -0
- package/lib/module/components/icons/index.js +13 -0
- package/lib/module/components/icons/index.js.map +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +136 -744
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/config/api.js +26 -0
- package/lib/module/config/api.js.map +1 -0
- package/lib/module/context/AuthContext.js +335 -0
- package/lib/module/context/AuthContext.js.map +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +106 -0
- package/lib/module/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/module/hooks/useConnections.js +119 -125
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useUserConnections.js +140 -0
- package/lib/module/hooks/useUserConnections.js.map +1 -0
- package/lib/module/index.js +51 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiClient.js +298 -0
- package/lib/module/services/apiClient.js.map +1 -0
- package/lib/module/services/authService.js +905 -0
- package/lib/module/services/authService.js.map +1 -0
- package/lib/module/services/biometricPinService.js +173 -0
- package/lib/module/services/biometricPinService.js.map +1 -0
- package/lib/module/services/connectedAccountsService.js +255 -0
- package/lib/module/services/connectedAccountsService.js.map +1 -0
- package/lib/module/services/googleAuthService.js +258 -0
- package/lib/module/services/googleAuthService.js.map +1 -0
- package/lib/module/services/imageCompressionService.js +250 -0
- package/lib/module/services/imageCompressionService.js.map +1 -0
- package/lib/module/services/jwtStorageService.js +239 -0
- package/lib/module/services/jwtStorageService.js.map +1 -0
- package/lib/module/services/mobileTrainingService.js +172 -0
- package/lib/module/services/mobileTrainingService.js.map +1 -0
- package/lib/module/services/pinEncryptionService.js +75 -0
- package/lib/module/services/pinEncryptionService.js.map +1 -0
- package/lib/module/services/pinStorageUtils.js +93 -0
- package/lib/module/services/pinStorageUtils.js.map +1 -0
- package/lib/module/services/platformAuthService.js +943 -704
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/services/storageService.js +383 -0
- package/lib/module/services/storageService.js.map +1 -0
- package/lib/module/services/trainingApiHelpers.js +67 -0
- package/lib/module/services/trainingApiHelpers.js.map +1 -0
- package/lib/module/services/userConnectionsService.js +476 -0
- package/lib/module/services/userConnectionsService.js.map +1 -0
- package/lib/module/services/youtubeMigrationService.js +404 -0
- package/lib/module/services/youtubeMigrationService.js.map +1 -0
- package/lib/module/theme/index.js +244 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/utils/eventUtils.js +270 -0
- package/lib/module/utils/eventUtils.js.map +1 -0
- package/lib/module/utils/haptics.js +59 -0
- package/lib/module/utils/haptics.js.map +1 -0
- package/lib/module/utils/imagePreloader.js +3 -0
- package/lib/module/utils/imagePreloader.js.map +1 -0
- package/lib/typescript/api/index.d.ts +8 -0
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/BodyText.d.ts +10 -0
- package/lib/typescript/components/BodyText.d.ts.map +1 -0
- package/lib/typescript/components/BrandMark.d.ts +11 -0
- package/lib/typescript/components/BrandMark.d.ts.map +1 -0
- package/lib/typescript/components/CodeInput.d.ts +10 -0
- package/lib/typescript/components/CodeInput.d.ts.map +1 -0
- package/lib/typescript/components/EmailInput.d.ts +8 -0
- package/lib/typescript/components/EmailInput.d.ts.map +1 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +12 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +1 -0
- package/lib/typescript/components/GoogleButton.d.ts +11 -0
- package/lib/typescript/components/GoogleButton.d.ts.map +1 -0
- package/lib/typescript/components/HeadingGroup.d.ts +11 -0
- package/lib/typescript/components/HeadingGroup.d.ts.map +1 -0
- package/lib/typescript/components/ModalHeader.d.ts +11 -0
- package/lib/typescript/components/ModalHeader.d.ts.map +1 -0
- package/lib/typescript/components/ModalSheet.d.ts +13 -0
- package/lib/typescript/components/ModalSheet.d.ts.map +1 -0
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +29 -4
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +14 -0
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -0
- package/lib/typescript/components/PersonaImage.d.ts +8 -0
- package/lib/typescript/components/PersonaImage.d.ts.map +1 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +10 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +1 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +10 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinCreationScreen.d.ts +10 -0
- package/lib/typescript/components/PinCreationScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinInput.d.ts +11 -1
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +11 -0
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +1 -0
- package/lib/typescript/components/PlatformToggle.d.ts +20 -0
- package/lib/typescript/components/PlatformToggle.d.ts.map +1 -0
- package/lib/typescript/components/PrimaryButton.d.ts +22 -0
- package/lib/typescript/components/PrimaryButton.d.ts.map +1 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts +9 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +1 -0
- package/lib/typescript/components/SignInStep.d.ts +12 -0
- package/lib/typescript/components/SignInStep.d.ts.map +1 -0
- package/lib/typescript/components/TrainingModal.d.ts +12 -1
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +14 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/VerificationStep.d.ts +13 -0
- package/lib/typescript/components/VerificationStep.d.ts.map +1 -0
- package/lib/typescript/components/WelcomeScreen.d.ts +9 -0
- package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts +5 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkbox.d.ts +5 -0
- package/lib/typescript/components/icons/Checkbox.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkmark.d.ts +5 -0
- package/lib/typescript/components/icons/Checkmark.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts +5 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contenticon.d.ts +5 -0
- package/lib/typescript/components/icons/Contenticon.d.ts.map +1 -0
- package/lib/typescript/components/icons/EnochE.d.ts +5 -0
- package/lib/typescript/components/icons/EnochE.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts +5 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +1 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts +5 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +1 -0
- package/lib/typescript/components/icons/index.d.ts +12 -0
- package/lib/typescript/components/icons/index.d.ts.map +1 -0
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/config/api.d.ts +24 -0
- package/lib/typescript/config/api.d.ts.map +1 -0
- package/lib/typescript/context/AuthContext.d.ts +34 -0
- package/lib/typescript/context/AuthContext.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +11 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnections.d.ts +10 -5
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +12 -0
- package/lib/typescript/hooks/useUserConnections.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +24 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiClient.d.ts +91 -0
- package/lib/typescript/services/apiClient.d.ts.map +1 -0
- package/lib/typescript/services/authService.d.ts +216 -0
- package/lib/typescript/services/authService.d.ts.map +1 -0
- package/lib/typescript/services/biometricPinService.d.ts +29 -0
- package/lib/typescript/services/biometricPinService.d.ts.map +1 -0
- package/lib/typescript/services/connectedAccountsService.d.ts +56 -0
- package/lib/typescript/services/connectedAccountsService.d.ts.map +1 -0
- package/lib/typescript/services/googleAuthService.d.ts +63 -0
- package/lib/typescript/services/googleAuthService.d.ts.map +1 -0
- package/lib/typescript/services/imageCompressionService.d.ts +37 -0
- package/lib/typescript/services/imageCompressionService.d.ts.map +1 -0
- package/lib/typescript/services/jwtStorageService.d.ts +86 -0
- package/lib/typescript/services/jwtStorageService.d.ts.map +1 -0
- package/lib/typescript/services/mobileTrainingService.d.ts +45 -0
- package/lib/typescript/services/mobileTrainingService.d.ts.map +1 -0
- package/lib/typescript/services/pinEncryptionService.d.ts +17 -0
- package/lib/typescript/services/pinEncryptionService.d.ts.map +1 -0
- package/lib/typescript/services/pinStorageUtils.d.ts +25 -0
- package/lib/typescript/services/pinStorageUtils.d.ts.map +1 -0
- package/lib/typescript/services/platformAuthService.d.ts +34 -109
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/services/storageService.d.ts +128 -0
- package/lib/typescript/services/storageService.d.ts.map +1 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts +38 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +1 -0
- package/lib/typescript/services/userConnectionsService.d.ts +90 -0
- package/lib/typescript/services/userConnectionsService.d.ts.map +1 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts +12 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +416 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +39 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/utils/eventUtils.d.ts +108 -0
- package/lib/typescript/utils/eventUtils.d.ts.map +1 -0
- package/lib/typescript/utils/haptics.d.ts +11 -0
- package/lib/typescript/utils/haptics.d.ts.map +1 -0
- package/lib/typescript/utils/imagePreloader.d.ts +2 -0
- package/lib/typescript/utils/imagePreloader.d.ts.map +1 -0
- package/package.json +158 -145
- package/src/api/index.ts +41 -0
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +3 -0
- package/src/assets/images/EnochE.svg +19 -0
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +3 -0
- package/src/assets/images/Personalitytraits.svg +3 -0
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +3 -0
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +20 -0
- package/src/assets/images/basicproficon.svg +43 -0
- package/src/assets/images/basicprofile.svg +3 -0
- package/src/assets/images/checkmark.svg +4 -0
- package/src/assets/images/contentanalysis.svg +3 -0
- package/src/assets/images/contenticon.svg +23 -0
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +18 -0
- package/src/assets/images/x-close.svg +3 -0
- package/src/components/BodyText.tsx +33 -0
- package/src/components/BrandMark.tsx +62 -0
- package/src/components/CodeInput.tsx +32 -0
- package/src/components/EmailInput.tsx +31 -0
- package/src/components/ExistingUserDataConfirmation.tsx +507 -0
- package/src/components/GoogleButton.tsx +55 -0
- package/src/components/HeadingGroup.tsx +49 -0
- package/src/components/ModalHeader.tsx +125 -0
- package/src/components/ModalSheet.tsx +57 -0
- package/src/components/Onairos.tsx +422 -424
- package/src/components/OnairosButton.tsx +339 -359
- package/src/components/OnairosSignInButton.tsx +166 -0
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PersonaImage.tsx +79 -0
- package/src/components/PersonaLoadingScreen.tsx +201 -0
- package/src/components/PersonalizationConsentScreen.tsx +410 -0
- package/src/components/PinCreationScreen.tsx +492 -0
- package/src/components/PinInput.tsx +555 -343
- package/src/components/PlatformConnectorsStep.tsx +892 -0
- package/src/components/PlatformToggle.tsx +226 -0
- package/src/components/PrimaryButton.tsx +214 -0
- package/src/components/SignInMatchAnimation.tsx +225 -0
- package/src/components/SignInStep.tsx +217 -0
- package/src/components/TrainingModal.tsx +1047 -737
- package/src/components/UniversalOnboarding.tsx +2888 -1820
- package/src/components/VerificationStep.tsx +198 -0
- package/src/components/WelcomeScreen.tsx +473 -0
- package/src/components/icons/Basicproficon.tsx +30 -0
- package/src/components/icons/Basicprofile.tsx +17 -0
- package/src/components/icons/Checkbox.tsx +17 -0
- package/src/components/icons/Checkmark.tsx +24 -0
- package/src/components/icons/Contentanalysis.tsx +17 -0
- package/src/components/icons/Contenticon.tsx +30 -0
- package/src/components/icons/EnochE.tsx +39 -0
- package/src/components/icons/Personalityicon.tsx +22 -0
- package/src/components/icons/Personalityprofile.tsx +17 -0
- package/src/components/icons/Personalitytraits.tsx +17 -0
- package/src/components/icons/Userpreferences.tsx +17 -0
- package/src/components/icons/index.ts +12 -0
- package/src/components/onboarding/OAuthWebView.tsx +232 -838
- package/src/config/api.ts +25 -0
- package/src/context/AuthContext.tsx +393 -0
- package/src/hooks/useConnectedAccounts.ts +139 -0
- package/src/hooks/useConnections.ts +129 -131
- package/src/hooks/useUserConnections.ts +166 -0
- package/src/index.ts +94 -49
- package/src/services/apiClient.ts +337 -0
- package/src/services/authService.ts +1008 -0
- package/src/services/biometricPinService.ts +193 -0
- package/src/services/connectedAccountsService.ts +290 -0
- package/src/services/googleAuthService.ts +279 -0
- package/src/services/imageCompressionService.ts +303 -0
- package/src/services/jwtStorageService.ts +257 -0
- package/src/services/mobileTrainingService.ts +204 -0
- package/src/services/pinEncryptionService.ts +76 -0
- package/src/services/pinStorageUtils.ts +97 -0
- package/src/services/platformAuthService.ts +1346 -1113
- package/src/services/storageService.ts +452 -0
- package/src/services/trainingApiHelpers.ts +67 -0
- package/src/services/userConnectionsService.ts +557 -0
- package/src/services/youtubeMigrationService.ts +454 -0
- package/src/theme/index.ts +239 -0
- package/src/types/index.ts +265 -238
- package/src/utils/eventUtils.ts +303 -0
- package/src/utils/haptics.ts +59 -0
- package/src/utils/imagePreloader.ts +2 -0
- package/README.md +0 -375
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/UniversalOnboarding.tsx.new +0 -455
|
@@ -7,9 +7,6 @@ exports.OAuthWebView = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _reactNativeWebview = require("react-native-webview");
|
|
10
|
-
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
11
|
-
var _constants = require("../../constants");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
11
|
const {
|
|
15
12
|
width,
|
|
@@ -22,806 +19,200 @@ const OAuthWebView = ({
|
|
|
22
19
|
platform = 'platform',
|
|
23
20
|
onComplete
|
|
24
21
|
}) => {
|
|
25
|
-
var _url$split$, _url$split$2;
|
|
26
22
|
const [isLoading, setIsLoading] = (0, _react.useState)(true);
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
const [isRetryable, setIsRetryable] = (0, _react.useState)(true);
|
|
30
|
-
const [retryCount, setRetryCount] = (0, _react.useState)(0);
|
|
31
|
-
const webViewRef = (0, _react.useRef)(null);
|
|
32
|
-
const timeoutRef = (0, _react.useRef)(null);
|
|
33
|
-
console.log('🌐 Opening OAuth WebView with URL:', url);
|
|
34
|
-
console.log('🔗 Platform:', platform);
|
|
35
|
-
console.log('📱 URL Components:', {
|
|
36
|
-
protocol: url.split('://')[0],
|
|
37
|
-
domain: (_url$split$ = url.split('://')[1]) === null || _url$split$ === void 0 ? void 0 : _url$split$.split('/')[0],
|
|
38
|
-
path: (_url$split$2 = url.split('://')[1]) === null || _url$split$2 === void 0 ? void 0 : _url$split$2.split('/').slice(1).join('/')
|
|
39
|
-
});
|
|
23
|
+
const [timeoutReached, setTimeoutReached] = (0, _react.useState)(false);
|
|
24
|
+
console.log('Opening OAuth WebView with URL:', url);
|
|
40
25
|
|
|
41
|
-
// Set up timeout
|
|
26
|
+
// Set up a timeout to prevent infinite waiting
|
|
42
27
|
_react.default.useEffect(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (timeoutRef.current) {
|
|
65
|
-
clearTimeout(timeoutRef.current);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}, []);
|
|
69
|
-
const onNavigationStateChange = navState => {
|
|
70
|
-
const currentUrl = navState.url;
|
|
71
|
-
console.log('🌐 Navigation state changed:', {
|
|
72
|
-
url: currentUrl,
|
|
73
|
-
canGoBack: navState.canGoBack,
|
|
74
|
-
canGoForward: navState.canGoForward,
|
|
75
|
-
loading: navState.loading,
|
|
76
|
-
title: navState.title
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// Don't process if still loading
|
|
80
|
-
if (navState.loading) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Check if this URL indicates OAuth completion
|
|
85
|
-
if (isOAuthComplete(currentUrl)) {
|
|
86
|
-
console.log('🎉 OAuth completion detected!');
|
|
87
|
-
|
|
88
|
-
// Extract the result
|
|
89
|
-
const result = extractOAuthResult(currentUrl);
|
|
90
|
-
if (result.success) {
|
|
91
|
-
console.log('✅ OAuth completed successfully:', result);
|
|
92
|
-
|
|
93
|
-
// Clear timeout
|
|
94
|
-
if (timeoutRef.current) {
|
|
95
|
-
clearTimeout(timeoutRef.current);
|
|
96
|
-
timeoutRef.current = null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Call success callback
|
|
100
|
-
if (onSuccess && result.code) {
|
|
101
|
-
onSuccess(result.code);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Close the WebView
|
|
28
|
+
const timeout = setTimeout(() => {
|
|
29
|
+
console.log(`⏰ OAuth timeout reached for ${platform} after 1 minutes`);
|
|
30
|
+
setTimeoutReached(true);
|
|
31
|
+
}, 60000); // 1 minutes timeout
|
|
32
|
+
|
|
33
|
+
return () => clearTimeout(timeout);
|
|
34
|
+
}, [platform]);
|
|
35
|
+
const handleNavigationStateChange = navState => {
|
|
36
|
+
console.log(`Navigation state changed for ${platform}:`, navState.url);
|
|
37
|
+
|
|
38
|
+
// Check for the final redirect to onairos.uk domain (this means backend callback completed)
|
|
39
|
+
const isFinalRedirect = navState.url.includes('onairos.uk/Home') || navState.url.includes('onairos.uk/home') || navState.url.includes('onairos.uk/success') || navState.url.startsWith('https://onairos.uk/Home') || navState.url.startsWith('https://onairos.uk/home');
|
|
40
|
+
|
|
41
|
+
// For all platforms, we need to wait for the backend callback to complete
|
|
42
|
+
// The backend processes the OAuth callback and then redirects to onairos.uk/Home
|
|
43
|
+
if (isFinalRedirect) {
|
|
44
|
+
console.log(`${platform} OAuth completed - backend callback finished and redirected to Home`);
|
|
45
|
+
onSuccess('success');
|
|
46
|
+
|
|
47
|
+
// Close the OAuth window after a small delay to ensure redirect is processed
|
|
48
|
+
setTimeout(() => {
|
|
105
49
|
if (onComplete) {
|
|
50
|
+
console.log(`Closing ${platform} OAuth window after callback completion`);
|
|
106
51
|
onComplete();
|
|
107
52
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// Clear timeout
|
|
112
|
-
if (timeoutRef.current) {
|
|
113
|
-
clearTimeout(timeoutRef.current);
|
|
114
|
-
timeoutRef.current = null;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Set error state
|
|
118
|
-
setError('OAuth authentication failed');
|
|
119
|
-
setErrorMessage(result.error || 'Authentication failed');
|
|
120
|
-
setIsRetryable(true);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Additional check for Gmail specific patterns
|
|
125
|
-
if (platform === 'email' || platform === 'gmail') {
|
|
126
|
-
const gmailPatterns = ['onairos.uk/Home', 'onairos.uk/home', 'https://onairos.uk/Home', 'https://onairos.uk/home'];
|
|
127
|
-
for (const pattern of gmailPatterns) {
|
|
128
|
-
if (currentUrl.includes(pattern)) {
|
|
129
|
-
console.log('✅ Gmail OAuth success detected via home page redirect');
|
|
130
|
-
|
|
131
|
-
// Clear timeout
|
|
132
|
-
if (timeoutRef.current) {
|
|
133
|
-
clearTimeout(timeoutRef.current);
|
|
134
|
-
timeoutRef.current = null;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Call success callback with Gmail-specific code
|
|
138
|
-
if (onSuccess) {
|
|
139
|
-
onSuccess('gmail_success');
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Close the WebView
|
|
143
|
-
if (onComplete) {
|
|
144
|
-
onComplete();
|
|
145
|
-
}
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Check for error URLs
|
|
152
|
-
const errorPatterns = ['error=', 'error_description=', 'access_denied', 'user_cancelled', 'cancelled', 'denied'];
|
|
153
|
-
for (const pattern of errorPatterns) {
|
|
154
|
-
if (currentUrl.includes(pattern)) {
|
|
155
|
-
console.log('❌ OAuth error detected in URL:', pattern);
|
|
156
|
-
|
|
157
|
-
// Clear timeout
|
|
158
|
-
if (timeoutRef.current) {
|
|
159
|
-
clearTimeout(timeoutRef.current);
|
|
160
|
-
timeoutRef.current = null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Parse error details
|
|
164
|
-
try {
|
|
165
|
-
const urlObj = new URL(currentUrl);
|
|
166
|
-
const params = new URLSearchParams(urlObj.search);
|
|
167
|
-
const errorDescription = params.get('error_description') || params.get('error') || 'Authentication failed';
|
|
168
|
-
setError('OAuth authentication failed');
|
|
169
|
-
setErrorMessage(errorDescription);
|
|
170
|
-
setIsRetryable(true);
|
|
171
|
-
} catch (parseError) {
|
|
172
|
-
setError('OAuth authentication failed');
|
|
173
|
-
setErrorMessage('Authentication failed');
|
|
174
|
-
setIsRetryable(true);
|
|
175
|
-
}
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
const handleLoadEnd = () => {
|
|
181
|
-
setIsLoading(false);
|
|
182
|
-
setError(null);
|
|
183
|
-
setErrorMessage('');
|
|
184
|
-
};
|
|
185
|
-
const handleError = syntheticEvent => {
|
|
186
|
-
const {
|
|
187
|
-
nativeEvent
|
|
188
|
-
} = syntheticEvent;
|
|
189
|
-
console.error('🚨 WebView error details:', {
|
|
190
|
-
description: nativeEvent.description,
|
|
191
|
-
code: nativeEvent.code,
|
|
192
|
-
domain: nativeEvent.domain,
|
|
193
|
-
url: nativeEvent.url,
|
|
194
|
-
canGoBack: nativeEvent.canGoBack,
|
|
195
|
-
canGoForward: nativeEvent.canGoForward,
|
|
196
|
-
loading: nativeEvent.loading,
|
|
197
|
-
target: nativeEvent.target,
|
|
198
|
-
title: nativeEvent.title
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
// Check for specific NSURLErrorDomain codes
|
|
202
|
-
let errorMessage = 'Failed to load OAuth page.';
|
|
203
|
-
let isRetryable = true;
|
|
204
|
-
if (nativeEvent.domain === 'NSURLErrorDomain') {
|
|
205
|
-
switch (nativeEvent.code) {
|
|
206
|
-
case -1009:
|
|
207
|
-
// NSURLErrorNotConnectedToInternet
|
|
208
|
-
errorMessage = 'No internet connection. Please check your network and try again.';
|
|
209
|
-
isRetryable = true;
|
|
210
|
-
break;
|
|
211
|
-
case -1003:
|
|
212
|
-
// NSURLErrorCannotFindHost
|
|
213
|
-
errorMessage = 'Cannot reach authentication server. Please check your internet connection.';
|
|
214
|
-
isRetryable = true;
|
|
215
|
-
break;
|
|
216
|
-
case -1001:
|
|
217
|
-
// NSURLErrorTimedOut
|
|
218
|
-
errorMessage = 'Connection timed out. Please try again.';
|
|
219
|
-
isRetryable = true;
|
|
220
|
-
break;
|
|
221
|
-
case -1200:
|
|
222
|
-
// NSURLErrorSecureConnectionFailed
|
|
223
|
-
errorMessage = 'Secure connection failed. Please try again.';
|
|
224
|
-
isRetryable = true;
|
|
225
|
-
break;
|
|
226
|
-
case -1022:
|
|
227
|
-
// NSURLErrorAppTransportSecurityRequiresSecureConnection
|
|
228
|
-
errorMessage = 'App Transport Security error. Connection must be secure.';
|
|
229
|
-
isRetryable = false;
|
|
230
|
-
break;
|
|
231
|
-
case -1004:
|
|
232
|
-
// NSURLErrorCannotConnectToHost
|
|
233
|
-
errorMessage = 'Cannot connect to authentication server. Please try again later.';
|
|
234
|
-
isRetryable = true;
|
|
235
|
-
break;
|
|
236
|
-
case -1005:
|
|
237
|
-
// NSURLErrorNetworkConnectionLost
|
|
238
|
-
errorMessage = 'Network connection lost. Please check your connection and try again.';
|
|
239
|
-
isRetryable = true;
|
|
240
|
-
break;
|
|
241
|
-
case -1020:
|
|
242
|
-
// NSURLErrorDataNotAllowed
|
|
243
|
-
errorMessage = 'Data not allowed. Please check your cellular data settings.';
|
|
244
|
-
isRetryable = true;
|
|
245
|
-
break;
|
|
246
|
-
default:
|
|
247
|
-
errorMessage = `Network error (${nativeEvent.code}): ${nativeEvent.description || 'Please check your connection and try again.'}`;
|
|
248
|
-
isRetryable = true;
|
|
249
|
-
}
|
|
250
|
-
} else if (nativeEvent.domain === 'WebKitErrorDomain') {
|
|
251
|
-
switch (nativeEvent.code) {
|
|
252
|
-
case 102:
|
|
253
|
-
// WebKitErrorFrameLoadInterruptedByPolicyChange
|
|
254
|
-
errorMessage = 'Page load was interrupted. Please try again.';
|
|
255
|
-
isRetryable = true;
|
|
256
|
-
break;
|
|
257
|
-
case 204:
|
|
258
|
-
// WebKitErrorPlugInLoadFailed
|
|
259
|
-
errorMessage = 'Plugin failed to load. Please try again.';
|
|
260
|
-
isRetryable = true;
|
|
261
|
-
break;
|
|
262
|
-
default:
|
|
263
|
-
errorMessage = `WebKit error (${nativeEvent.code}): ${nativeEvent.description || 'Please try again.'}`;
|
|
264
|
-
isRetryable = true;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
console.error('🔴 OAuth WebView Error:', errorMessage);
|
|
268
|
-
|
|
269
|
-
// Implement smart retry logic
|
|
270
|
-
if (isRetryable && retryCount < 3) {
|
|
271
|
-
console.log(`🔄 Auto-retrying OAuth load (attempt ${retryCount + 1}/3) in 3 seconds...`);
|
|
272
|
-
setRetryCount(prev => prev + 1);
|
|
273
|
-
setIsLoading(true);
|
|
274
|
-
setError(null);
|
|
275
|
-
|
|
276
|
-
// Retry after a delay with exponential backoff
|
|
277
|
-
const retryDelay = 3000 * Math.pow(2, retryCount); // 3s, 6s, 12s
|
|
278
|
-
setTimeout(() => {
|
|
279
|
-
if (webViewRef.current) {
|
|
280
|
-
console.log(`🔄 Attempting retry ${retryCount + 1}...`);
|
|
281
|
-
webViewRef.current.reload();
|
|
282
|
-
}
|
|
283
|
-
}, retryDelay);
|
|
284
|
-
} else {
|
|
285
|
-
setError(errorMessage);
|
|
286
|
-
setIsLoading(false);
|
|
287
|
-
|
|
288
|
-
// Show additional help for persistent errors
|
|
289
|
-
if (retryCount >= 3) {
|
|
290
|
-
console.log('❌ Maximum retries reached, showing error to user');
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
const handleOpenInBrowser = () => {
|
|
295
|
-
console.log('Opening OAuth URL in external browser:', url);
|
|
296
|
-
_reactNative.Linking.openURL(url).catch(err => {
|
|
297
|
-
console.error('Failed to open URL in browser:', err);
|
|
298
|
-
setError('Unable to open browser. Please check your device settings.');
|
|
299
|
-
});
|
|
300
|
-
};
|
|
301
|
-
const handleRetry = () => {
|
|
302
|
-
console.log('Manual retry requested');
|
|
303
|
-
setError(null);
|
|
304
|
-
setErrorMessage('');
|
|
305
|
-
setIsRetryable(true);
|
|
306
|
-
setIsLoading(true);
|
|
307
|
-
setRetryCount(0);
|
|
308
|
-
if (webViewRef.current) {
|
|
309
|
-
webViewRef.current.reload();
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Get platform-specific icon
|
|
315
|
-
*/
|
|
316
|
-
const getPlatformIcon = platform => {
|
|
317
|
-
switch (platform) {
|
|
318
|
-
case 'instagram':
|
|
319
|
-
return 'photo-camera';
|
|
320
|
-
case 'youtube':
|
|
321
|
-
return 'smart-display';
|
|
322
|
-
case 'pinterest':
|
|
323
|
-
return 'push-pin';
|
|
324
|
-
case 'reddit':
|
|
325
|
-
return 'forum';
|
|
326
|
-
case 'email':
|
|
327
|
-
return 'email';
|
|
328
|
-
default:
|
|
329
|
-
return 'link';
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Get platform-specific color
|
|
335
|
-
*/
|
|
336
|
-
const getPlatformColor = platform => {
|
|
337
|
-
switch (platform) {
|
|
338
|
-
case 'instagram':
|
|
339
|
-
return '#E1306C';
|
|
340
|
-
case 'youtube':
|
|
341
|
-
return '#FF0000';
|
|
342
|
-
case 'pinterest':
|
|
343
|
-
return '#E60023';
|
|
344
|
-
case 'reddit':
|
|
345
|
-
return '#FF4500';
|
|
346
|
-
case 'email':
|
|
347
|
-
return '#4285F4';
|
|
348
|
-
default:
|
|
349
|
-
return _constants.COLORS.primary;
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// Check if URL indicates OAuth completion
|
|
354
|
-
const isOAuthComplete = url => {
|
|
355
|
-
// Gmail OAuth completion patterns
|
|
356
|
-
const gmailSuccessPatterns = ['https://onairos.uk/Home', 'https://onairos.uk/home', 'onairos.uk/Home', 'onairos.uk/home', process.env.APP_HOME_URL].filter(Boolean);
|
|
357
|
-
|
|
358
|
-
// Check for success redirect patterns
|
|
359
|
-
for (const pattern of gmailSuccessPatterns) {
|
|
360
|
-
if (url.includes(pattern)) {
|
|
361
|
-
console.log('✅ OAuth success detected via redirect to:', pattern);
|
|
362
|
-
return true;
|
|
363
|
-
}
|
|
53
|
+
}, 1000); // Increased delay to ensure backend processing completes
|
|
54
|
+
return; // Exit early to avoid other triggers
|
|
364
55
|
}
|
|
365
56
|
|
|
366
|
-
//
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
console.log('✅ OAuth success detected via callback parameter:', pattern);
|
|
372
|
-
return true;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
// Check for specific callback URLs (more targeted than generic words)
|
|
377
|
-
const callbackUrlPatterns = ['/callback', '/oauth/callback', '/auth/callback', 'redirect_uri', 'onairos.uk/callback', 'onairos.uk/oauth'];
|
|
378
|
-
for (const pattern of callbackUrlPatterns) {
|
|
379
|
-
if (url.includes(pattern)) {
|
|
380
|
-
console.log('✅ OAuth success detected via callback URL pattern:', pattern);
|
|
381
|
-
return true;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// Check for error patterns
|
|
386
|
-
const errorPatterns = ['error=', 'error_description=', 'oauth_error=', 'auth_error=', 'access_denied', 'user_cancelled', 'cancelled', 'denied'];
|
|
387
|
-
for (const pattern of errorPatterns) {
|
|
388
|
-
if (url.includes(pattern)) {
|
|
389
|
-
console.log('❌ OAuth error detected via pattern:', pattern);
|
|
390
|
-
return false;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
return false;
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
// Extract OAuth result from URL
|
|
397
|
-
const extractOAuthResult = url => {
|
|
398
|
-
try {
|
|
399
|
-
const urlObj = new URL(url);
|
|
400
|
-
const params = new URLSearchParams(urlObj.search);
|
|
401
|
-
|
|
402
|
-
// Check for error first
|
|
403
|
-
const error = params.get('error') || params.get('error_description') || params.get('oauth_error');
|
|
404
|
-
if (error) {
|
|
405
|
-
return {
|
|
406
|
-
success: false,
|
|
407
|
-
error
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
// Check for success indicators
|
|
412
|
-
const code = params.get('code') || params.get('authorization_code') || params.get('auth_code');
|
|
413
|
-
const accessToken = params.get('access_token') || params.get('oauth_token') || params.get('token');
|
|
414
|
-
if (code || accessToken) {
|
|
415
|
-
return {
|
|
416
|
-
success: true,
|
|
417
|
-
code: code || accessToken
|
|
418
|
-
};
|
|
419
|
-
}
|
|
57
|
+
// Log intermediate callback URLs for debugging but don't close yet
|
|
58
|
+
const isIntermediateCallback = navState.url.includes('/callback') || navState.url.includes('code=') || navState.url.includes('token=') || navState.url.includes('access_token=');
|
|
59
|
+
if (isIntermediateCallback && !isFinalRedirect) {
|
|
60
|
+
console.log(`Detected intermediate callback URL for ${platform}:`, navState.url);
|
|
61
|
+
console.log('Waiting for backend processing to complete and final redirect...');
|
|
420
62
|
|
|
421
|
-
//
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
console.log('✅ Gmail OAuth success detected via home page redirect');
|
|
426
|
-
return {
|
|
427
|
-
success: true,
|
|
428
|
-
code: 'gmail_home_redirect'
|
|
429
|
-
};
|
|
430
|
-
}
|
|
63
|
+
// Extract authorization code for logging purposes
|
|
64
|
+
const codeMatch = navState.url.match(/code=([^&]+)/);
|
|
65
|
+
if (codeMatch && codeMatch[1]) {
|
|
66
|
+
console.log('OAuth code detected:', codeMatch[1]);
|
|
431
67
|
}
|
|
432
68
|
|
|
433
|
-
//
|
|
434
|
-
|
|
435
|
-
return {
|
|
436
|
-
success: true,
|
|
437
|
-
code: 'oauth_complete'
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
return {
|
|
441
|
-
success: false,
|
|
442
|
-
error: 'OAuth completion not detected'
|
|
443
|
-
};
|
|
444
|
-
} catch (error) {
|
|
445
|
-
console.error('Error parsing OAuth URL:', error);
|
|
446
|
-
return {
|
|
447
|
-
success: false,
|
|
448
|
-
error: 'Invalid OAuth callback URL'
|
|
449
|
-
};
|
|
69
|
+
// Don't close yet - wait for the backend to process and redirect
|
|
70
|
+
return;
|
|
450
71
|
}
|
|
451
72
|
};
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
456
|
-
style: styles.header
|
|
457
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
458
|
-
onPress: onClose,
|
|
459
|
-
style: styles.closeButton
|
|
460
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
461
|
-
name: "close",
|
|
462
|
-
size: 24,
|
|
463
|
-
color: "#000"
|
|
464
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
465
|
-
style: styles.titleContainer
|
|
466
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
467
|
-
name: getPlatformIcon(platform),
|
|
468
|
-
size: 20,
|
|
469
|
-
color: getPlatformColor(platform)
|
|
470
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
471
|
-
style: styles.titleText
|
|
472
|
-
}, platform.charAt(0).toUpperCase() + platform.slice(1), " OAuth"))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
473
|
-
style: styles.errorContainer
|
|
474
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
475
|
-
name: "error-outline",
|
|
476
|
-
size: 48,
|
|
477
|
-
color: "#FF6B6B"
|
|
478
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
479
|
-
style: styles.errorTitle
|
|
480
|
-
}, "Connection Error"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
481
|
-
style: styles.errorMessage
|
|
482
|
-
}, errorMessage || error), error.includes('internet') || error.includes('network') ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
483
|
-
style: styles.helpContainer
|
|
484
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
485
|
-
style: styles.helpTitle
|
|
486
|
-
}, "\uD83D\uDCA1 Troubleshooting Steps:"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
487
|
-
style: styles.helpText
|
|
488
|
-
}, "\u2022 Check your Wi-Fi or cellular connection"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
489
|
-
style: styles.helpText
|
|
490
|
-
}, "\u2022 Try switching between Wi-Fi and cellular"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
491
|
-
style: styles.helpText
|
|
492
|
-
}, "\u2022 Ensure you're not using a VPN that blocks OAuth"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
493
|
-
style: styles.helpText
|
|
494
|
-
}, "\u2022 Close other apps that might be using bandwidth")) : error.includes('timeout') ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
495
|
-
style: styles.helpContainer
|
|
496
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
497
|
-
style: styles.helpTitle
|
|
498
|
-
}, "\u23F1\uFE0F Connection Timeout:"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
499
|
-
style: styles.helpText
|
|
500
|
-
}, "\u2022 Your connection might be slow"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
501
|
-
style: styles.helpText
|
|
502
|
-
}, "\u2022 Try again when you have a stronger signal"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
503
|
-
style: styles.helpText
|
|
504
|
-
}, "\u2022 Use \"Open in Browser\" for better reliability")) : error.includes('secure') || error.includes('SSL') ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
505
|
-
style: styles.helpContainer
|
|
506
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
507
|
-
style: styles.helpTitle
|
|
508
|
-
}, "\uD83D\uDD12 Security Error:"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
509
|
-
style: styles.helpText
|
|
510
|
-
}, "\u2022 Check your device's date and time settings"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
511
|
-
style: styles.helpText
|
|
512
|
-
}, "\u2022 Update your device's operating system"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
513
|
-
style: styles.helpText
|
|
514
|
-
}, "\u2022 Try \"Open in Browser\" as an alternative")) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
515
|
-
style: styles.helpContainer
|
|
516
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
517
|
-
style: styles.helpTitle
|
|
518
|
-
}, "\uD83D\uDD27 General Solutions:"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
519
|
-
style: styles.helpText
|
|
520
|
-
}, "\u2022 Close and reopen the app"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
521
|
-
style: styles.helpText
|
|
522
|
-
}, "\u2022 Check your internet connection"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
523
|
-
style: styles.helpText
|
|
524
|
-
}, "\u2022 Use \"Open in Browser\" for better reliability")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
525
|
-
style: styles.buttonContainer
|
|
526
|
-
}, isRetryable && /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
527
|
-
style: styles.retryButton,
|
|
528
|
-
onPress: handleRetry
|
|
529
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
530
|
-
name: "refresh",
|
|
531
|
-
size: 20,
|
|
532
|
-
color: "#fff",
|
|
533
|
-
style: styles.buttonIcon
|
|
534
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
535
|
-
style: styles.retryButtonText
|
|
536
|
-
}, "Retry")), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
537
|
-
style: styles.browserButton,
|
|
538
|
-
onPress: handleOpenInBrowser
|
|
539
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
540
|
-
name: "open-in-browser",
|
|
541
|
-
size: 20,
|
|
542
|
-
color: "#666",
|
|
543
|
-
style: styles.buttonIcon
|
|
544
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
545
|
-
style: styles.browserButtonText
|
|
546
|
-
}, "Open in Browser"))), retryCount >= 3 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
547
|
-
style: styles.persistentErrorContainer
|
|
548
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
549
|
-
style: styles.persistentErrorText
|
|
550
|
-
}, "Still having trouble? Try these steps:"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
551
|
-
style: styles.persistentErrorStep
|
|
552
|
-
}, "1. Use \"Open in Browser\" for more reliable authentication"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
553
|
-
style: styles.persistentErrorStep
|
|
554
|
-
}, "2. Check if other apps can access the internet"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
555
|
-
style: styles.persistentErrorStep
|
|
556
|
-
}, "3. Restart your device if the problem persists"))));
|
|
557
|
-
}
|
|
558
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
74
|
+
style: styles.modalContainer
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
559
76
|
style: styles.container
|
|
560
77
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
561
78
|
style: styles.header
|
|
562
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
80
|
+
style: styles.title
|
|
81
|
+
}, "Connect ", platform.charAt(0).toUpperCase() + platform.slice(1)), timeoutReached && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
82
|
+
style: styles.timeoutText
|
|
83
|
+
}, "Taking longer than expected..."), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
563
84
|
onPress: onClose,
|
|
564
85
|
style: styles.closeButton
|
|
565
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}
|
|
570
|
-
style: styles.
|
|
571
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
color: getPlatformColor(platform)
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
87
|
+
style: styles.closeButtonText
|
|
88
|
+
}, "\u2715"))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
89
|
+
style: styles.webViewContainer
|
|
90
|
+
}, isLoading && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
91
|
+
style: styles.loadingContainer
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
93
|
+
size: "large",
|
|
94
|
+
color: "#1BA9D4"
|
|
575
95
|
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
576
|
-
style: styles.
|
|
577
|
-
},
|
|
578
|
-
onPress: handleOpenInBrowser,
|
|
579
|
-
style: styles.browserButton
|
|
580
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
581
|
-
name: "open-in-browser",
|
|
582
|
-
size: 20,
|
|
583
|
-
color: "#666"
|
|
584
|
-
}))), /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
|
|
585
|
-
ref: webViewRef,
|
|
96
|
+
style: styles.loadingText
|
|
97
|
+
}, "Loading...")), /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
|
|
586
98
|
source: {
|
|
587
99
|
uri: url
|
|
588
100
|
},
|
|
589
|
-
onNavigationStateChange:
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
onHttpError: syntheticEvent => {
|
|
593
|
-
const {
|
|
594
|
-
nativeEvent
|
|
595
|
-
} = syntheticEvent;
|
|
596
|
-
console.error('WebView HTTP error:', nativeEvent);
|
|
597
|
-
setError('Failed to load OAuth page. Please check your internet connection.');
|
|
598
|
-
setIsLoading(false);
|
|
599
|
-
},
|
|
101
|
+
onNavigationStateChange: handleNavigationStateChange,
|
|
102
|
+
onLoadStart: () => setIsLoading(true),
|
|
103
|
+
onLoadEnd: () => setIsLoading(false),
|
|
600
104
|
style: styles.webView,
|
|
601
105
|
javaScriptEnabled: true,
|
|
602
106
|
domStorageEnabled: true,
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
mixedContentMode: "compatibility",
|
|
107
|
+
cacheEnabled: true // Enable cache to remember previous logins
|
|
108
|
+
,
|
|
109
|
+
incognito: false // Disable incognito mode to remember previous logins
|
|
110
|
+
,
|
|
608
111
|
thirdPartyCookiesEnabled: true,
|
|
609
|
-
sharedCookiesEnabled: true
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1",
|
|
614
|
-
onShouldStartLoadWithRequest: request => {
|
|
615
|
-
console.log('WebView attempting to load:', request.url);
|
|
616
|
-
|
|
617
|
-
// Block about:srcdoc and other problematic URLs
|
|
618
|
-
if (request.url.startsWith('about:') || request.url.startsWith('data:') || request.url === 'about:blank') {
|
|
619
|
-
console.log('Blocking problematic URL:', request.url);
|
|
620
|
-
return false;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
// Allow all other requests
|
|
624
|
-
return true;
|
|
625
|
-
},
|
|
626
|
-
onLoadStart: syntheticEvent => {
|
|
112
|
+
sharedCookiesEnabled: true // Enable shared cookies for Google sign-in
|
|
113
|
+
,
|
|
114
|
+
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1",
|
|
115
|
+
onError: syntheticEvent => {
|
|
627
116
|
const {
|
|
628
117
|
nativeEvent
|
|
629
118
|
} = syntheticEvent;
|
|
630
|
-
console.
|
|
631
|
-
|
|
119
|
+
console.error(`WebView error for ${platform}:`, nativeEvent);
|
|
120
|
+
// Don't automatically close on error - let user retry or manually close
|
|
632
121
|
},
|
|
633
|
-
|
|
122
|
+
onHttpError: syntheticEvent => {
|
|
634
123
|
const {
|
|
635
124
|
nativeEvent
|
|
636
125
|
} = syntheticEvent;
|
|
637
|
-
console.
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
}, "Failed to load the authentication page. Error: ", errorName), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
650
|
-
style: styles.retryButton,
|
|
651
|
-
onPress: handleRetry
|
|
652
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
653
|
-
style: styles.retryButtonText
|
|
654
|
-
}, "Retry"))),
|
|
655
|
-
renderLoading: () => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
656
|
-
style: styles.loadingContainer
|
|
657
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
658
|
-
size: "large",
|
|
659
|
-
color: _constants.COLORS.primary
|
|
660
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
661
|
-
style: styles.loadingText
|
|
662
|
-
}, "Loading ", platform, "...")),
|
|
663
|
-
injectedJavaScript: `
|
|
664
|
-
// Prevent white screen issues
|
|
665
|
-
window.addEventListener('error', function(e) {
|
|
666
|
-
console.log('JavaScript error:', e.message);
|
|
667
|
-
});
|
|
668
|
-
|
|
669
|
-
// Handle OAuth redirects
|
|
670
|
-
window.addEventListener('beforeunload', function(e) {
|
|
671
|
-
console.log('Page unloading:', window.location.href);
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
// Monitor for OAuth completion
|
|
675
|
-
setInterval(function() {
|
|
676
|
-
if (window.location.href.includes('code=') ||
|
|
677
|
-
window.location.href.includes('access_token=') ||
|
|
678
|
-
window.location.href.includes('oauth_token=') ||
|
|
679
|
-
window.location.href.includes('api2.onairos.uk')) {
|
|
680
|
-
console.log('OAuth completion detected:', window.location.href);
|
|
681
|
-
}
|
|
682
|
-
}, 1000);
|
|
683
|
-
|
|
684
|
-
true; // Required for injected JavaScript
|
|
685
|
-
`
|
|
686
|
-
}));
|
|
126
|
+
console.error(`WebView HTTP error for ${platform}: ${nativeEvent.statusCode}`, nativeEvent.url);
|
|
127
|
+
|
|
128
|
+
// If we get a 404 or similar error on the final redirect, it might still be successful
|
|
129
|
+
if (nativeEvent.url && nativeEvent.url.includes('onairos.uk')) {
|
|
130
|
+
console.log('HTTP error on onairos.uk domain - treating as potential success');
|
|
131
|
+
onSuccess('success');
|
|
132
|
+
if (onComplete) {
|
|
133
|
+
setTimeout(() => onComplete(), 1000);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}))));
|
|
687
138
|
};
|
|
688
139
|
exports.OAuthWebView = OAuthWebView;
|
|
689
140
|
const styles = _reactNative.StyleSheet.create({
|
|
141
|
+
modalContainer: {
|
|
142
|
+
position: 'absolute',
|
|
143
|
+
top: 0,
|
|
144
|
+
left: 0,
|
|
145
|
+
right: 0,
|
|
146
|
+
bottom: 0,
|
|
147
|
+
width: width,
|
|
148
|
+
height: height,
|
|
149
|
+
backgroundColor: '#fff',
|
|
150
|
+
zIndex: 9999
|
|
151
|
+
},
|
|
690
152
|
container: {
|
|
691
153
|
flex: 1,
|
|
692
|
-
backgroundColor: '#fff'
|
|
154
|
+
backgroundColor: '#fff',
|
|
155
|
+
width: width,
|
|
156
|
+
height: height,
|
|
157
|
+
position: 'absolute',
|
|
158
|
+
top: 0,
|
|
159
|
+
left: 0,
|
|
160
|
+
right: 0,
|
|
161
|
+
bottom: 0,
|
|
162
|
+
zIndex: 999
|
|
693
163
|
},
|
|
694
164
|
header: {
|
|
695
165
|
flexDirection: 'row',
|
|
696
166
|
alignItems: 'center',
|
|
697
|
-
|
|
698
|
-
|
|
167
|
+
justifyContent: 'space-between',
|
|
168
|
+
paddingHorizontal: 16,
|
|
169
|
+
paddingVertical: 12,
|
|
699
170
|
borderBottomWidth: 1,
|
|
700
|
-
borderBottomColor: '#
|
|
701
|
-
|
|
171
|
+
borderBottomColor: '#E5E5E5',
|
|
172
|
+
backgroundColor: '#fff',
|
|
173
|
+
zIndex: 1000
|
|
702
174
|
},
|
|
703
|
-
|
|
175
|
+
title: {
|
|
176
|
+
fontSize: 18,
|
|
177
|
+
fontWeight: '600',
|
|
178
|
+
color: '#333',
|
|
704
179
|
flex: 1,
|
|
705
|
-
|
|
706
|
-
alignItems: 'center',
|
|
707
|
-
justifyContent: 'center'
|
|
708
|
-
},
|
|
709
|
-
titleText: {
|
|
710
|
-
marginLeft: 8,
|
|
711
|
-
fontSize: 16,
|
|
712
|
-
fontWeight: '500',
|
|
713
|
-
color: '#000'
|
|
180
|
+
textAlign: 'center'
|
|
714
181
|
},
|
|
715
182
|
closeButton: {
|
|
716
|
-
padding: 8
|
|
717
|
-
position: 'absolute',
|
|
718
|
-
left: 16,
|
|
719
|
-
zIndex: 10
|
|
183
|
+
padding: 8
|
|
720
184
|
},
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
alignItems: 'center',
|
|
730
|
-
justifyContent: 'center'
|
|
185
|
+
closeButtonText: {
|
|
186
|
+
fontSize: 20,
|
|
187
|
+
color: '#666'
|
|
188
|
+
},
|
|
189
|
+
webViewContainer: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
width: width,
|
|
192
|
+
height: height - 60 // Adjust for header height
|
|
731
193
|
},
|
|
732
194
|
webView: {
|
|
733
|
-
flex: 1
|
|
195
|
+
flex: 1,
|
|
196
|
+
width: '100%',
|
|
197
|
+
height: '100%'
|
|
734
198
|
},
|
|
735
199
|
loadingContainer: {
|
|
736
200
|
..._reactNative.StyleSheet.absoluteFillObject,
|
|
737
|
-
backgroundColor: 'rgba(255, 255, 255, 0.8)',
|
|
738
201
|
alignItems: 'center',
|
|
739
|
-
justifyContent: 'center'
|
|
202
|
+
justifyContent: 'center',
|
|
203
|
+
backgroundColor: 'rgba(255, 255, 255, 0.9)',
|
|
204
|
+
zIndex: 1
|
|
740
205
|
},
|
|
741
206
|
loadingText: {
|
|
742
|
-
marginTop:
|
|
207
|
+
marginTop: 12,
|
|
743
208
|
fontSize: 16,
|
|
744
209
|
color: '#666'
|
|
745
210
|
},
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
justifyContent: 'center',
|
|
750
|
-
padding: 20
|
|
751
|
-
},
|
|
752
|
-
errorTitle: {
|
|
753
|
-
fontSize: 18,
|
|
754
|
-
fontWeight: '600',
|
|
755
|
-
color: '#333',
|
|
756
|
-
marginTop: 16,
|
|
757
|
-
marginBottom: 8
|
|
758
|
-
},
|
|
759
|
-
errorMessage: {
|
|
760
|
-
fontSize: 14,
|
|
761
|
-
color: '#666',
|
|
762
|
-
textAlign: 'center',
|
|
763
|
-
marginBottom: 20
|
|
764
|
-
},
|
|
765
|
-
retryButton: {
|
|
766
|
-
backgroundColor: _constants.COLORS.primary,
|
|
767
|
-
paddingHorizontal: 24,
|
|
768
|
-
paddingVertical: 12,
|
|
769
|
-
borderRadius: 8,
|
|
770
|
-
marginRight: 10,
|
|
771
|
-
flexDirection: 'row',
|
|
772
|
-
alignItems: 'center',
|
|
773
|
-
justifyContent: 'center'
|
|
774
|
-
},
|
|
775
|
-
retryButtonText: {
|
|
776
|
-
color: '#fff',
|
|
777
|
-
fontSize: 16,
|
|
778
|
-
fontWeight: '600'
|
|
779
|
-
},
|
|
780
|
-
buttonContainer: {
|
|
781
|
-
flexDirection: 'row',
|
|
782
|
-
justifyContent: 'center',
|
|
783
|
-
alignItems: 'center',
|
|
784
|
-
marginTop: 10
|
|
785
|
-
},
|
|
786
|
-
browserButtonText: {
|
|
787
|
-
color: '#666',
|
|
788
|
-
fontSize: 16,
|
|
789
|
-
fontWeight: '600'
|
|
790
|
-
},
|
|
791
|
-
helpContainer: {
|
|
792
|
-
marginBottom: 20
|
|
793
|
-
},
|
|
794
|
-
helpTitle: {
|
|
795
|
-
fontSize: 18,
|
|
796
|
-
fontWeight: '600',
|
|
797
|
-
color: '#333',
|
|
798
|
-
marginBottom: 8
|
|
799
|
-
},
|
|
800
|
-
helpText: {
|
|
801
|
-
fontSize: 14,
|
|
802
|
-
color: '#666',
|
|
803
|
-
textAlign: 'center'
|
|
804
|
-
},
|
|
805
|
-
buttonIcon: {
|
|
806
|
-
marginRight: 10
|
|
807
|
-
},
|
|
808
|
-
persistentErrorContainer: {
|
|
809
|
-
marginTop: 20,
|
|
810
|
-
padding: 20,
|
|
811
|
-
backgroundColor: '#f8f8f8',
|
|
812
|
-
borderRadius: 8
|
|
813
|
-
},
|
|
814
|
-
persistentErrorText: {
|
|
815
|
-
fontSize: 16,
|
|
816
|
-
fontWeight: '600',
|
|
817
|
-
color: '#333',
|
|
818
|
-
marginBottom: 10
|
|
819
|
-
},
|
|
820
|
-
persistentErrorStep: {
|
|
821
|
-
fontSize: 14,
|
|
822
|
-
color: '#666',
|
|
211
|
+
timeoutText: {
|
|
212
|
+
fontSize: 12,
|
|
213
|
+
color: '#FF6B6B',
|
|
823
214
|
textAlign: 'center',
|
|
824
|
-
|
|
215
|
+
marginTop: 4
|
|
825
216
|
}
|
|
826
217
|
});
|
|
827
218
|
//# sourceMappingURL=OAuthWebView.js.map
|