<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use DomainException;

/**
 * Exception thrown when a refresh token has already been rotated but is still in grace period.
 *
 * This is a benign condition during multi-tab race conditions - the client should use
 * the newer token. The cookie should NOT be cleared in this case.
 *
 * @see Story 1.4 - Connexion utilisateur
 */
final class TokenAlreadyRotatedException extends DomainException
{
    public function __construct()
    {
        parent::__construct('Token already rotated, use new token');
    }
}
