/** * Validates a passed-in token. * * @param string $token A urlencoded base64 encoded security token. * @param SecurityTokenDecoder $signer The signer to use (configured in config.php) * @return SecurityToken An object representation of the token data. */ public function validateToken($token, $signer) { if (count(explode(':', $token)) != 7) { $token = urldecode(base64_decode($token)); } if (empty($token)) { throw new Exception("Missing or invalid security token"); } return $signer->createToken($token); }
/** * Validates a passed-in token. * * @param string $token A urlencoded base64 encoded security token. * @param SecurityTokenDecoder $signer The signer to use (configured in config.php) * @return SecurityToken An object representation of the token data. */ public function validateToken($token, $signer) { if (empty($token)) { throw new Exception("Missing or invalid security token"); } return $signer->createToken($token); }