mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
* linear settings and oauth * unfurl * unfurl impl fix for recent merge from main * fetch labels * state icon * linear icon * uninstall hook * lint * i18n * cleanup * use workspace key, reduce icon size * determine completion percentage * extract completionPercentage to separate method
26 lines
678 B
TypeScript
26 lines
678 B
TypeScript
import { IntegrationService, IntegrationType } from "@shared/types";
|
|
import Logger from "@server/logging/Logger";
|
|
import { 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", err);
|
|
}
|
|
}
|