79097123

Date: 2024-10-17 08:13:27
Score: 1
Natty:
Report link

I have found the answer.

The problem lies that the new version of firebase/php-jwt requires three arguments for the JWT::encode() method, while i am just putting two arguments there, therefor the token was not returned properly.

Originial JWT::encode

return JWT::encode($payload, self::$secret_key);

Update JWT::encode

return JWT::encode($payload, self::$secret_key, 'HS256');

Thank you for you time

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Joseph