Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native withOAuth logins not persisted after app restart #4417

Closed
ejdoh1 opened this issue Nov 17, 2019 · 4 comments
Closed

react-native withOAuth logins not persisted after app restart #4417

ejdoh1 opened this issue Nov 17, 2019 · 4 comments
Labels
React Native React Native related issue to-be-reproduced Used in order for Amplify to reproduce said issue

Comments

@ejdoh1
Copy link

ejdoh1 commented Nov 17, 2019

Describe the bug
After a fresh create react native app using RN 0.61.4 and using App.js and aws-exports.js from (known working) https://github.com/manueliglesias/hosted-ui-react-native-cli, the user does not remain signed in after the app is restarted.

To Reproduce

  1. Run the react native app from repo https://github.com/ejdoh1/rnhui
  2. react-native run-android
  3. Launch the app and login using Google or other
  4. After successful login, swipe-kill the app
  5. Relaunch the app noting the user is prompted to re-login

Expected behavior
As with the example repo using RN version 0.58, after the app is relaunched, the user should not be prompted to sign in again.

Environment
  System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 115.46 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.2 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.13.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 78.0.3904.97
    Firefox: 69.0.1
    Safari: 13.0.1
  npmPackages:
    @babel/core: ^7.7.2 => 7.7.2 
    @babel/runtime: ^7.7.2 => 7.7.2 
    @react-native-community/eslint-config: ^0.0.5 => 0.0.5 
    aws-amplify: ^1.2.4 => 1.2.4 
    aws-amplify-react-native: ^2.2.3 => 2.2.3 
    babel-jest: ^24.9.0 => 24.9.0 
    eslint: ^6.6.0 => 6.6.0 
    jest: ^24.9.0 => 24.9.0 
    metro-react-native-babel-preset: ^0.57.0 => 0.57.0 
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.4 => 0.61.4 
    react-test-renderer: 16.9.0 => 16.9.0 
  npmGlobalPackages:
    @aws-amplify/cli: 3.9.0
    aws-sdk: 2.553.0
    azure-functions-core-tools: 2.7.1724
    expo-cli: 3.0.10
    ios-deploy: 1.9.4
    npm-update-all: 1.0.1
    npm: 6.13.0
    powerbi-visuals-tools: 3.1.5
    react-devtools: 3.6.3
    react-native-cli: 2.0.1
    react-native-rename: 2.4.1
    serverless-azure-functions: 1.0.0
    serverless: 1.57.0

Smartphone (please complete the following information):

  • Device: Google Pixel 2
  • OS: Android 9

Sample code
https://github.com/ejdoh1/rnhui

Logs
After app re-launch...

[Log] [DEBUG] 06:11.274 AuthClass - getting current authenticated user (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129117)
[Log] [DEBUG] 06:11.275 AuthClass - cannot load federated user from auth storage (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129117)
[Log] [DEBUG] 06:11.275 AuthClass - get current authenticated userpool user (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129117)
[Log] [DEBUG] 06:11.276 AuthClass - Failed to get user from user pool (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129117)
[Log] [DEBUG] 06:11.276 AuthClass - The user is not authenticated by the error – "No current user" (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129127)
[Log] [DEBUG] 06:11.277 withOAuth - not authenticated (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129117)
[Log] [DEBUG] 06:11.357 urlListener - urlListener – {url: null} (blob:http://localhost:8081/79e78c06-d02a-4029-945b-c9b21ccf63af, line 129127)
@ejdoh1 ejdoh1 added the to-be-reproduced Used in order for Amplify to reproduce said issue label Nov 17, 2019
@anthonyhumphreys
Copy link
Contributor

#4351

@Ashish-Nanda
Copy link
Contributor

Ashish-Nanda commented Jan 20, 2020

Hi @ejdoh1 . Are you still facing this issue?
The fix for this problem has been available since version 2.2.0 and related issue threads have confirmed the fix as can be seen here: #4380

@stale
Copy link

stale bot commented Jan 27, 2020

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed Jan 27, 2020
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
React Native React Native related issue to-be-reproduced Used in order for Amplify to reproduce said issue
Projects
None yet
Development

No branches or pull requests

4 participants