From 92ed01adc594e8b484c058476a40efce3c4fd285 Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 25 Jun 2024 19:37:22 +0200 Subject: [PATCH] fix(jwt): log decode errors for better debugging Added error logging to capture JWT decode exceptions, aiding in pinpointing issues during authentication. This change improves troubleshooting and enhances the overall robustness of the JWT handling process. --- classes/core_jwt_manager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/core_jwt_manager.php b/classes/core_jwt_manager.php index 0fd08ea..0e5544f 100644 --- a/classes/core_jwt_manager.php +++ b/classes/core_jwt_manager.php @@ -99,6 +99,7 @@ class core_jwt_manager try { $decoded = JWT::decode($keyvalue, new Key($secret, 'HS256')); } catch (\Exception $e) { + error_log('JWT decode error: ' . $e->getMessage()); throw new \moodle_exception('invalidkey'); }