code: public function validateLoginToken(string $token): ?array
      {
          $token = base64_decode($token);
          $serializedData = Security::decrypt($token, $this->getKey(), $this->getSalt());
          if ($serializedData === false) {
              return null;
          }
          $data = unserialize($serializedData);
          if (!empty($data['expireInterval']) && !empty($data['timestamp'])) {
              $tokenCreated = new Time($data['timestamp']);
              if (!$tokenCreated->wasWithinLast($data['expireInterval'])) {
                  return null;
              }
          }
  
          return $data;
      }
docs: Validates the token.
  
  @param string $token Token
  @param string $key   Security key
  @param string $salt  Security salt
  @return array|null