Closed arifszn closed 2 years ago
Unfortunately, you didn't share which version of the package and library you are using and no code that I can try to reproduce the problem with 😭, so I'll have to do a bit of guesswork here.
Can you confirm that the ID you expected is present in the data->localId
property of the returned SignInResult
object and the firebaseUserId
is null
?
If you're indeed talking about the properties, please note that you need to use the firebaseUserId()
method to access the property.
Otherwise, please provide more information so that I can try to reproduce the problem 🙏 .
@jeromegamez, Sorry I missed out on the information.
The code I am using:
$signInResult = $this->auth->signInWithFacebookAccessToken($accessToken);
$firebaseUser = $this->auth->getUser($signInResult->firebaseUserId());
This is dumped $signInResult
:
This is dumped $signInResult->firebaseUserId()
:
Yes, the data->localId
has the same uid which is in the firebase console.
The version I am using:
"name": "kreait/laravel-firebase",
"version": "3.2.0",
Laravel version:
"name": "laravel/framework",
"version": "v8.70.2",
PHP version: 8
Thank you for providing the additional info! I was able to confirm the issue and have added support for the localId
field in https://github.com/kreait/firebase-php/commit/ff7c396cb143e298c72f1a19967c0986b4821cfd (5.x) and https://github.com/kreait/firebase-php/commit/35ec1919c6ed8d4f88134e4fd6953d9f044af836 (6.x), will create a new release shortly and notify you here.
Released with https://github.com/kreait/firebase-php/releases/tag/6.0.1 and https://github.com/kreait/firebase-php/releases/tag/5.26.1
You should be able to fetch the update with a composer update -W
Thanks again for raising the issue!
I have a user on firebase having email
x@gmail.com
and provider google. Now, when I usesignInWithFacebookAccessToken
with facebook account having the same mail, I am getting nullfirebaseUserId
.The rest of the information are correct and the uid is showing elsewhere in
data->localId
.