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

google signin not prompting for credentials after original prompt #675

Closed
buchidiai opened this issue Jun 4, 2019 · 5 comments
Closed

Comments

@buchidiai
Copy link

When i log in with google for the first time on the app it prompts me to enter the email then password and it returns a token and it shows up in firebase console, but after i kill the app and lets say i wanna use a different email, it doesnt show the prompt to choose previous account or enter a new one, it automatically uses the old credentials i used before. This behaviors is on android and ios. If i delete the app from ios or android the prompt comes back for the initial sigin in but after that it doesnt show up anymore.

  • Explain the steps we need to take to reproduce the issue.

ran npm react-native google-singin
real-native link react-native google-singin
added necesaary files etc
built projects on ios and android
attempted to login
prompt showed up and i entered email information
killed app and removed authentication from firebase
attempted to login
instantly authenticated with previous information without a prompt

i am using the example from https://rnfirebase.io/docs/v5.x.x/auth/social-auth

App.js

handleGoogleLogin = async () =>{
		try {
			let account  = {};
			// add any configuration settings here:
			await GoogleSignin.hasPlayServices({ showPlayServicesUpdateDialog: true });
		
			const data = await GoogleSignin.signIn();
			console.log('data', data)
		
			// create a new firebase credential with the token
			const credential =  firebase.auth.GoogleAuthProvider.credential(data.idToken, data.accessToken)
			console.log('credential', credential)
			// login with credential
			const firebaseUserCredential = await firebase.auth().signInWithCredential(credential);
			console.log('firebaseUserCredential', firebaseUserCredential)
			await firebase.auth().signOut();
		
			console.warn(JSON.stringify(firebaseUserCredential.user.toJSON()));
		  } catch (e) {
			console.error(e);
		  }
	}

  • Include a gif if you think it may help.

  • If you're asking for help, please make it easy for us to help you!

Expected Behavior

i thought it would prompt me to enter new credential or select old one

Actual Behavior

created authentication without prompting for email or password

Environment

Please provide the version of your

  • react-native
react-native-cli: 2.0.1
react-native: 0.59.8
  • react-native-google-signin
    "react-native-google-signin": "^2.0.0",
  • cocoapods and GoogleSignIn pod version (if applicable)
  pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
  pod 'GoogleSignIn', '~> 4.4.0'
  • version of Android, gradle, android plugin for gradle, play-services-auth and version of the Google Play Services app on your phone (if applicable)
   ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
        googlePlayServicesAuthVersion = "16.0.1" 
    }
    repositories {
        google()
        jcenter()
        maven {
        url 'https://maven.fabric.io/public'
    }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:firebase-plugins:1.2.0'
        classpath 'io.fabric.tools:gradle:1.26.1'

package.json

"dependencies": {
    "native-base": "^2.12.1",
    "react": "16.8.3",
    "react-native": "^0.59.8",
    "react-native-actionsheet": "^2.4.2",
    "react-native-device-info": "^2.0.1",
    "react-native-elements": "^1.1.0",
    "react-native-fbsdk": "^0.8.0",
    "react-native-firebase": "5.3.1",
    "react-native-gesture-handler": "^1.2.0",
    "react-native-google-signin": "^2.0.0",
    "react-native-image-crop-picker": "^0.24.1",
    "react-native-image-picker": "^0.28.1",
    "react-native-keychain": "^3.1.3",
    "react-native-vector-icons": "^6.4.2",
    "react-navigation": "^3.9.1",
    "uuid": "^3.3.2"
  },

react-native info

React Native Environment Info:
   System:
     OS: macOS 10.14.4
     CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
     Memory: 919.98 MB / 16.00 GB
     Shell: 3.2.57 - /bin/bash
   Binaries:
     Node: 10.13.0 - /usr/local/bin/node
     Yarn: 1.9.4 - /usr/local/bin/yarn
     npm: 6.9.0 - /usr/local/bin/npm
     Watchman: 4.9.0 - /usr/local/bin/watchman
   SDKs:
     iOS SDK:
       Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
   IDEs:
     Android Studio: 3.4 AI-183.6156.11.34.5522156
     Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
   npmPackages:
     react: 16.8.3 => 16.8.3 
     react-native: ^0.59.8 => 0.59.8 
   npmGlobalPackages:
     react-native-cli: 2.0.1
     react-native-git-upgrade: 0.2.7
     react-native-vector-icons: 6.0.1
@Aksh0377
Copy link

I am also having the same problem, Have you found any solution?

@mikehardy
Copy link

@bsdAdventures @Aksh0377 I just integrated google sign in and noticed the same thing. @bsdAdventures you closed this without followup, did you learn anything you can share?

@vonovak
Copy link
Member

vonovak commented Dec 9, 2019

@mikehardy this library unfortunately only supports one logged in user, see #200

@mikehardy
Copy link

mikehardy commented Dec 10, 2019

I had not seen that, thanks very much for the pointer. I'll follow along there if this becomes a requirement for me

@chrisedington
Copy link

Even though it only supports one user, what if I want to completely log out of one user and then into another?

It seems like I can only have one, even after signOut and RevokeAccess have been called?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants