kreait / firebase-tokens-php

A PHP library to work with Firebase tokens
MIT License
223 stars 33 forks source link

createCustomToken method returns wrong token type #43

Closed grebban-veljko closed 2 years ago

grebban-veljko commented 2 years ago

Hello!

I am trying to upgrade to version 2.2.0 of this package from version 1.16.1 but I am getting the following error:

auth::createCustomToken(): Return value must be of type Lcobucci\JWT\UnencryptedToken, Kreait\Firebase\JWT\Token returned

This is what my code calling the method looks like:

$customToken = Firebase::project(applicationId())->auth()->createCustomToken($identifier, [ 'email' => $model->email, ]);

jeromegamez commented 2 years ago

Could you provide a reproducible example? The line you provided doesn't look like anything that I know 😅

grebban-veljko commented 2 years ago

I am going to try to provide an example asap. But for now I would like to mention that if in file Kreait\Firebase\Contract\Auth.php on row 252 for the createCustomToken method you change the expected return type to \Kreait\Firebase\JWT\Token from Lcobucci\JWT\UnencryptedToken then there is no error and it works fine.

jeromegamez commented 2 years ago

Kreait\Firebase\Contract\Auth is located in the SDK, not this library - can you ensure that you're running on a current version of the SDK (6.2.0 at the time of this comment)?

grebban-veljko commented 2 years ago

The problem was with my test not the package. Thanks for your help.