Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[firebase_auth] Removed automatic signing in behaviour when signing in with phone auth.#1568

Merged
collinjackson merged 14 commits intoflutter:masterfrom
awazgyawali:phone_auth_creds
May 6, 2019
Merged

[firebase_auth] Removed automatic signing in behaviour when signing in with phone auth.#1568
collinjackson merged 14 commits intoflutter:masterfrom
awazgyawali:phone_auth_creds

Conversation

@awazgyawali
Copy link
Contributor

@awazgyawali awazgyawali commented May 5, 2019

This is a fix to issue flutter/flutter#22304.

The plugin demands auth credential while logging in with facebook, google, emailPassword. Which gives developer the option to create new account with it or link it to the existing user. But the phone auth used to behave differently, it directly used to sign in and create new user which was preventing developers to link it to the existing user. Thus this PR removes that behaviour and gives ability to extract phone auth cred and use it as required.

I have used Gson to parse and send the PhoneAuthCredential to the dart side. Not sure if its a good idea, suggestions are welcomed.

Note: This automatic signing in for phone auth was not enabled on the IOS side thus no changes have been made to the IOS code, let me know if I am missing something here.

To use this PR, copy the following lines to your pubspec.yaml file.

firebase_auth:
    git:
      url: git://github.com/awazgyawali/plugins/
      path: packages/firebase_auth

@awazgyawali
Copy link
Contributor Author

I think this is a very small and serious thing to address as the SDK is supposed to behave similarly to all the possible ways to sign in. Also, this PR will break the previous user's application as it will not sign in automatically and the user has to signInWithCredential themselves after the callback.

@creativecreatorormaybenot
Copy link
Contributor

This actually seems better than #973.

Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I made a few changes to reduce the public API surface area of this change.

});
}

static AuthCredential getCredentialFromObject({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing this constructor from the public API.

@collinjackson collinjackson merged commit 59053df into flutter:master May 6, 2019
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
…n with phone auth. (flutter#1568)

* Update phone auth on Android to avoid signing in the user automatically.
* Remove nextHandle from public API
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants