<?php
namespace App\EventListener;
use Lexik\Bundle\JWTAuthenticationBundle\Event\JWTExpiredEvent;
use Lexik\Bundle\JWTAuthenticationBundle\Response\JWTAuthenticationFailureResponse;
class JWTExpiredListener
{
/**
* @param JWTExpiredEvent $event
*/
public function onJWTExpired(JWTExpiredEvent $event)
{
/** @var JWTAuthenticationFailureResponse */
$response = $event->getResponse();
// Custom error message
$response->setMessage("Votre token est expiré, merci de le renouveller");
}
}