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

Typed property Firehed\JWT\JWT::$keys must not be accessed before initialization #10

Open
Firehed opened this issue Jan 27, 2022 · 0 comments
Labels

Comments

@Firehed
Copy link
Owner

Firehed commented Jan 27, 2022

Typed property Firehed\JWT\JWT::$keys must not be accessed before initialization in /app/vendor/firehed/jwt/src/JWT.php:49

To reproduce:

$jwt = new JWT(['a' => 'b']);
echo $jwt->getEncoded();

While this goes against the usage of explicitly calling setKeys() per the documentation, IMO it's a flawed API design where you can enter this situation at all. Regrettably, fixing it all the way through ends up being a breaking change somewhere along the way, likely either in the JWT constructor or in the getEncoded method.

@Firehed Firehed added the bug label Jan 27, 2022
Firehed added a commit that referenced this issue Apr 5, 2023
This is intended as a convenience tool to avoid having to work with too
many classes in too many places. It aims to simplify the end-user API.
See #10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant