aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

@aws-amplify/rtn custom browser tab is shown in recent apps, even after signInWithRedirect is completed. #13846

Open AnantTiwari001 opened 2 hours ago

AnantTiwari001 commented 2 hours ago

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

Amplify CLI

Environment information

# Put output below this line ``` System: OS: Windows 11 10.0.22631 CPU: (12) x64 AMD Ryzen 5 5600G with Radeon Graphics Memory: 1.19 GB / 7.39 GB Binaries: Node: 18.20.4 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD npm: 9.9.3 - C:\Program Files\nodejs\npm.CMD pnpm: 9.10.0 - ~\AppData\Roaming\npm\pnpm.CMD Watchman: 20240310.093207.0 - C:\ProgramData\chocolatey\bin\watchman.EXE Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527 npmPackages: @aws-amplify/react-native: ^1.0.22 => 1.1.4 @aws-amplify/rtn-web-browser: ^1.0.22 => 1.0.31 @babel/core: ^7.25.2 => 7.25.2 @babel/preset-env: ^7.25.4 => 7.25.4 @babel/runtime: ^7.20.0 => 7.25.0 @playwright/test: ^1.41.2 => 1.46.1 @react-native-async-storage/async-storage: ^1.23.1 => 1.24.0 @react-native-community/netinfo: 11.3.1 => 11.3.1 @react-native-community/slider: ^4.5.2 => 4.5.2 @react-native/babel-preset: 0.73.21 => 0.73.21 @react-native/eslint-config: 0.73.2 => 0.73.2 @react-native/metro-config: 0.73.5 => 0.73.5 @react-native/typescript-config: 0.73.1 => 0.73.1 @react-navigation/bottom-tabs: ^6.5.20 => 6.6.1 @react-navigation/drawer: ^6.6.15 => 6.7.2 @react-navigation/native: ^6.1.17 => 6.1.18 @react-navigation/native-stack: ^6.9.26 => 6.11.0 @reduxjs/toolkit: ^2.2.3 => 2.2.7 @reduxjs/toolkit-query: 1.0.0 @reduxjs/toolkit-query-react: 1.0.0 @reduxjs/toolkit-react: 1.0.0 @supersami/rn-foreground-service: ^2.1.1 => 2.1.1 @testing-library/react-native: ^12.5.1 => 12.6.0 @types/jest: ^29.5.12 => 29.5.12 @types/react: ^18.2.6 => 18.3.3 @types/react-test-renderer: ^18.0.0 => 18.3.0 @types/spotify-web-api-node: ^5.0.11 => 5.0.11 HelloWorld: 0.0.1 aws-amplify: ^6.0.21 => 6.5.1 aws-amplify/adapter-core: undefined () aws-amplify/analytics: undefined () aws-amplify/analytics/kinesis: undefined () aws-amplify/analytics/kinesis-firehose: undefined () aws-amplify/analytics/personalize: undefined () aws-amplify/analytics/pinpoint: undefined () aws-amplify/api: undefined () aws-amplify/api/server: undefined () aws-amplify/auth: undefined () aws-amplify/auth/cognito: undefined () aws-amplify/auth/cognito/server: undefined () aws-amplify/auth/enable-oauth-listener: undefined () aws-amplify/auth/server: undefined () aws-amplify/data: undefined () aws-amplify/data/server: undefined () aws-amplify/datastore: undefined () aws-amplify/in-app-messaging: undefined () aws-amplify/in-app-messaging/pinpoint: undefined () aws-amplify/push-notifications: undefined () aws-amplify/push-notifications/pinpoint: undefined () aws-amplify/storage: undefined () aws-amplify/storage/s3: undefined () aws-amplify/storage/s3/server: undefined () aws-amplify/storage/server: undefined () aws-amplify/utils: undefined () axios: ^1.6.7 => 1.7.4 detox: ^20.23.0 => 20.25.5 eslint: ^8.19.0 => 8.57.0 eslint-plugin-testing-library: ^6.2.2 => 6.3.0 expo: ^50.0.6 => 50.0.20 expo-auth-session: ~5.4.0 => 5.4.0 expo-av: ~13.10.5 => 13.10.6 expo-file-system: ~16.0.6 => 16.0.9 expo-image-picker: ~14.7.1 => 14.7.1 expo-notifications: ~0.27.8 => 0.27.8 expo-secure-store: ~12.8.1 => 12.8.1 expo-status-bar: ~1.11.1 => 1.11.1 expo-web-browser: ~12.8.2 => 12.8.2 ffmpeg-kit-react-native: ^6.0.2 => 6.0.2 jest: ^29.6.3 => 29.7.0 jest-jasmine2: ^29.7.0 => 29.7.0 prettier: 2.8.8 => 2.8.8 (3.3.3) react: 18.2.0 => 18.2.0 react-native: 0.73.5 => 0.73.5 react-native-bootsplash: ^5.5.3 => 5.5.3 react-native-dotenv: ^3.4.10 => 3.4.11 react-native-gesture-handler: ^2.15.0 => 2.18.1 react-native-get-random-values: ^1.11.0 => 1.11.0 react-native-image-colors: ^2.4.0 => 2.4.0 react-native-keyboard-aware-scroll-view: ^0.9.5 => 0.9.5 react-native-linear-gradient: ^2.8.3 => 2.8.3 react-native-reanimated: ^3.12.0 => 3.15.0 react-native-safe-area-context: ^4.10.4 => 4.10.9 react-native-screens: ~3.29.0 => 3.29.0 react-native-svg: 14.1.0 => 14.1.0 react-native-svg-transformer: ^1.4.0 => 1.5.0 react-native-view-shot: ^3.8.0 => 3.8.0 react-native-webview: 13.6.4 => 13.6.4 react-redux: ^9.1.0 => 9.1.2 react-test-renderer: 18.2.0 => 18.2.0 redux: ^5.0.1 => 5.0.1 redux-persist: ^6.0.0 => 6.0.0 redux-persist/integration/react: undefined () spotify-web-api-node: ^5.0.2 => 5.0.2 typescript: 5.0.4 => 5.0.4 npmGlobalPackages: @aws-amplify/cli: 12.12.6 detox-cli: 20.0.0 eas-cli: 11.0.3 jest: 29.7.0 json-server: 1.0.0-beta.1 lerna: 6.6.2 npm: 9.9.3 pnpm: 9.10.0 react-native-cli: 2.0.1 react-native-rename: 3.2.14 ts-node: 10.9.2 typescript: 5.5.4 yarn: 1.22.22 ```

Describe the bug

while using signInWithRedirect() from import {signInWithRedirect} from '@aws-amplify/auth'; a new chrome tab is opened as aspected but the issue is that tab remains there in the recently used apps in android even if login is completed successfully.

The same tab is used for the next sign section as well, if it's available.

Expected behavior

The tab shall not be shown in recently used apps from android section, even expo-web-browser has implemented this well with tab being cleared as soon as it gets in background.

Reproduction steps

  1. Initialize the project
  2. intialize the environment, libraries and backend from documentation
  3. follow the steps and try loging.

Code Snippet

// Put your code below this line.

Log output

``` // Put your logs below this line ```

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

Android Studio Emulator Medium Andriod11

Mobile Operating System

Android

Mobile Browser

Chrome

Mobile Browser Version

83.0.4103

Additional information and screenshots

image

HuiSF commented 2 hours ago

Hi @AnantTiwari001 thanks for opening this issue and the PR! We will look into this.