Skip to content

Commit 4948389

Browse files
fix(line): clear default access token when removing account
1 parent 9f241ea commit 4948389

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎extensions/line/src/config-adapter.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe("LINE config adapter", () => {
2020
channelSecret: "default-secret",
2121
tokenFile: "/tmp/default-token",
2222
secretFile: "/tmp/default-secret",
23+
name: "Default LINE",
2324
accounts: {
2425
alerts: {
2526
channelAccessToken: "alerts-token",
@@ -44,6 +45,7 @@ describe("LINE config adapter", () => {
4445
expect(nextCfg.channels?.line?.channelSecret).toBeUndefined();
4546
expect(nextCfg.channels?.line?.tokenFile).toBeUndefined();
4647
expect(nextCfg.channels?.line?.secretFile).toBeUndefined();
48+
expect(nextCfg.channels?.line?.name).toBeUndefined();
4749
expect(listLineAccountIds(nextCfg)).toEqual(["alerts"]);
4850
});
4951
});

‎extensions/line/src/config-adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const lineConfigAdapter = createScopedChannelConfigAdapter<
2121
resolveAccount: (cfg, accountId) =>
2222
resolveLineAccount({ cfg, accountId: accountId ?? undefined }),
2323
defaultAccountId: resolveDefaultLineAccountId,
24-
clearBaseFields: ["channelAccessToken", "channelSecret", "tokenFile", "secretFile"],
24+
clearBaseFields: ["channelAccessToken", "channelSecret", "tokenFile", "secretFile", "name"],
2525
resolveAllowFrom: (account) => account.config.allowFrom,
2626
formatAllowFrom: (allowFrom) => normalizeStringEntries(allowFrom).map(normalizeLineAllowFrom),
2727
});

0 commit comments

Comments
 (0)