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

feat: Allows Key instance to be used for encoding #575

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Oinkling
Copy link

@Oinkling Oinkling commented Aug 8, 2024

Allows an instance of Key to be passed as the second argument to JWT::encode and JWT::sign, making $alg optional.

This is more in line with how decoding works and as such it makes sense to streamline it.

This also generally makes the process easier in the use case where you get an instance of Key injected so you can just encode using JWT::encode($payload, $key) rather than JWT::encode($payload, $key->getKeyMaterial(), $key->getAlgorithm())

Allows an instance of Key to be passed as the second argument to
JWT::encode and JWT::sign, making $alg optional.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant