MCPcopy
hub / github.com/upstash/context7 / clearTokens

Function clearTokens

packages/cli/src/utils/auth.ts:65–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65export function clearTokens(): boolean {
66 const credentialsFile = getCredentialsFilePath();
67 let removed = false;
68 if (fs.existsSync(credentialsFile)) {
69 fs.unlinkSync(credentialsFile);
70 removed = true;
71 }
72 const legacyCredentialsFile = getLegacyFilePath(CREDENTIALS_FILE_NAME);
73 if (fs.existsSync(legacyCredentialsFile)) {
74 fs.unlinkSync(legacyCredentialsFile);
75 removed = true;
76 }
77 return removed;
78}
79
80export function isTokenExpired(tokens: TokenData): boolean {
81 if (!tokens.expires_at) {

Callers 3

loginCommandFunction · 0.85
logoutCommandFunction · 0.85
auth-utils.test.tsFile · 0.85

Calls 2

getCredentialsFilePathFunction · 0.85
getLegacyFilePathFunction · 0.85

Tested by

no test coverage detected