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.
This commit is contained in:
parent
5ae53cfc14
commit
92ed01adc5
1 changed files with 1 additions and 0 deletions
|
@ -99,6 +99,7 @@ class core_jwt_manager
|
||||||
try {
|
try {
|
||||||
$decoded = JWT::decode($keyvalue, new Key($secret, 'HS256'));
|
$decoded = JWT::decode($keyvalue, new Key($secret, 'HS256'));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
error_log('JWT decode error: ' . $e->getMessage());
|
||||||
throw new \moodle_exception('invalidkey');
|
throw new \moodle_exception('invalidkey');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue