Skip to content

Commit e09174b

Browse files
authored
Merge pull request #126 from markspolakovs/patch-1
Fix incorrect error message on invalid secret
2 parents 38ed240 + f86c679 commit e09174b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ public static function validate_token( $token = null, $refresh = false ) {
589589
try {
590590
$token = ! empty( $token ) ? JWT::decode( $token, $secret, [ 'HS256' ] ) : null;
591591
} catch ( \Exception $exception ) {
592-
$token = new \WP_Error( 'invalid-secret-key', $exception->getMessage() );
592+
return new \WP_Error( 'invalid-secret-key', $exception->getMessage() );
593593
}
594594

595595
/**

0 commit comments

Comments
 (0)