dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
570 stars 457 forks source link

(ios) Return rawNonce in credential result when authentication with A… #883

Open TheNotorius0 opened 2 weeks ago

TheNotorius0 commented 2 weeks ago

…pple is successful.

PR Type

What kind of change does this PR introduce?

PR Checklist

Please check your PR fulfills the following requirements:

Bugfixes:

New features/enhancements:

What is the purpose of this PR?

Fixes https://github.com/dpa99c/cordova-plugin-firebasex/issues/867, which was a follow-up of https://github.com/dpa99c/cordova-plugin-firebasex/issues/857

Basically, after you use FirebasePlugin.authenticateUserWithApple() you get a credential object. This object can be used to login with the Firebase javascript SDK:

const appleWebCredentials = appleProvider.credential({idToken: credential.idToken, rawNonce: credential.rawNonce});
firebase.auth().signInWithCredential(appleWebCredentials);

Unfortunately, the rawNonce is not passed from the plugin. This pull request fixes it.

Does this PR introduce a breaking change?

What testing has been done on the changes in the PR?

What testing has been done on existing functionality?

Other information