fix(route/twitter): Mask the error output to avoid leak token (#17193)

This commit is contained in:
Otstar Lin
2024-10-19 14:03:37 +08:00
committed by GitHub
parent 9852d9d1dc
commit 78bf6daf6c
+1 -1
View File
@@ -116,7 +116,7 @@ export const twitterGot = async (
agent,
};
} else if (auth) {
throw new ConfigNotFoundError(`Twitter cookie for token ${auth?.token} is not valid`);
throw new ConfigNotFoundError(`Twitter cookie for token ${auth?.token?.replace(/(\w{8})(\w+)/, (_, v1, v2) => v1 + '*'.repeat(v2.length))} is not valid`);
}
const jsonCookie = dispatchers
? Object.fromEntries(