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

"invalid-secret-key | Algorithm not allowed" with WPGatsby plugin #165

Open
Joelgeorgelive opened this issue Jun 17, 2022 · 6 comments
Open

Comments

@Joelgeorgelive
Copy link

Joelgeorgelive commented Jun 17, 2022

This happens only when WPGatsby plugin in installed on wordpress

wp-graphql-jwt-authentication / release-v0.5.2

Ran into this issue after trying to fetch Gql data using authToken.

File to edit: \wp-content\plugins\wp-graphql-jwt-authentication-release-v0.5.2\src\Auth.ph

Screenshot 2022-06-17 135004

Screenshot 2022-06-17 135142

This change fixed it , Now I can fetch data from Gql

Screenshot 2022-06-17 135328

try {
$token = ! empty( $token ) ? JWT::decode( $token, self::get_secret_key(),array_keys(JWT::$supported_algs) ) : null;
} catch ( Exception $exception ) {
$token = new \WP_Error( 'invalid-secret-key', $exception->getMessage() );
}

tried passing in array('HS256') or ['HS256'] didnt work. idk why!!...

P.S. did break my head for a day .... Hope it helps someone.. #notaprogrammer

Feel free to optimize this code!!

@Joelgeorgelive Joelgeorgelive changed the title "invalid-secret-key | Algorithm not allowed" "invalid-secret-key | Algorithm not allowed" with WPGatsby plugin Jul 5, 2022
@mrkhedri
Copy link

mrkhedri commented Jul 8, 2022

Same Issue

@gabacode
Copy link

@Joelgeorgelive thank you so much! Total lifesaver 🙌

@sarahannnicholson
Copy link

@Joelgeorgelive thank you! This worked for me too!

Is there a PR somewhere to bump?

@benjamin3105
Copy link

@Joelgeorgelive omg you rock! it took me almost a whole day of debugging before I saw your post

@lnikell
Copy link

lnikell commented Jan 24, 2023

Confirm, bug is still exist, the fix by @Joelgeorgelive works like a charm

@assemble-dev
Copy link

@Joelgeorgelive you are the greatest! Thanks for this

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

No branches or pull requests

7 participants