Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix incorrect error message on invalid secret
If a token with an invalid secret key is passed, the error returned will be `The iss do not match with this server` when the `iss` field is set correctly. This PR fixes that.
  • Loading branch information
markspolakovs authored Feb 26, 2021
commit f86c67921163454edad8c215e0ffe819c7183a56
2 changes: 1 addition & 1 deletion src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public static function validate_token( $token = null, $refresh = false ) {
try {
$token = ! empty( $token ) ? JWT::decode( $token, $secret, [ 'HS256' ] ) : null;
} catch ( \Exception $exception ) {
$token = new \WP_Error( 'invalid-secret-key', $exception->getMessage() );
return new \WP_Error( 'invalid-secret-key', $exception->getMessage() );
}

/**
Expand Down