validate(); /** @var MinecraftAccessKey|null $accessToken */ $accessToken = MinecraftAccessKey::findOne([ 'access_token' => $this->accessToken, 'client_token' => $this->clientToken, ]); if ($accessToken === null) { throw new ForbiddenOperationException('Invalid token.'); } $accessToken->refreshPrimaryKeyValue(); $accessToken->update(); $dataModel = new AuthenticateData($accessToken); return $dataModel; } }