Files
outline/plugins/linear/server/uninstall.ts
T
Tom Moor 66eee9007f chore: Upgrade to Typescript 6 (#12737)
* chore: Upgrade TypeScript to 6.0
2026-06-18 17:34:05 -04:00

28 lines
776 B
TypeScript

import { toError } from "@shared/utils/error";
import type { IntegrationType } from "@shared/types";
import { IntegrationService } from "@shared/types";
import Logger from "@server/logging/Logger";
import type { Integration } from "@server/models";
import { Linear } from "./linear";
export async function uninstall(
integration: Integration<IntegrationType.Embed>
) {
if (integration.service !== IntegrationService.Linear) {
return;
}
const authentication = await integration.$get("authentication");
if (!authentication) {
return;
}
try {
await Linear.revokeAccess(authentication.token);
} catch (err) {
// suppress error since this is a best-effort operation.
Logger.error("Failed to revoke Linear access token", toError(err));
}
}