mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 18:15:48 +00:00
fix(cliproxy): use sibling auth-paused/ dir to prevent token refresh loops
CLIProxyAPI's watcher uses filepath.Walk() which recursively scans all subdirectories of auth/. Moving paused tokens to auth/paused/ subdirectory didn't hide them from CLIProxyAPI, causing token refresh loops where paused tokens were immediately recreated. Solution: Use auth-paused/ as a sibling directory instead of auth/paused/ subdirectory. This places paused tokens completely outside CLIProxyAPI's scan path, preventing token discovery and refresh. Path change: - Before: ~/.ccs/cliproxy/auth/paused/ - After: ~/.ccs/cliproxy/auth-paused/
This commit is contained in:
1 parent
d87a653195
commit
4d31128b63
1 file changed
+7
-1
@@ -6,6 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Account storage: ~/.ccs/cliproxy/accounts.json
|
* Account storage: ~/.ccs/cliproxy/accounts.json
|
||||||
* Token storage: ~/.ccs/cliproxy/auth/ (flat structure, CLIProxyAPI discovers by type field)
|
* Token storage: ~/.ccs/cliproxy/auth/ (flat structure, CLIProxyAPI discovers by type field)
|
||||||
|
* Paused tokens: ~/.ccs/cliproxy/auth-paused/ (sibling dir, outside CLIProxyAPI scan path)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
@@ -138,9 +139,14 @@ export function getAccountsRegistryPath(): string {
|
|||||||
/**
|
/**
|
||||||
* Get path to paused tokens directory
|
* Get path to paused tokens directory
|
||||||
* Paused tokens are moved here so CLIProxyAPI won't discover them
|
* Paused tokens are moved here so CLIProxyAPI won't discover them
|
||||||
|
*
|
||||||
|
* Uses sibling directory (auth-paused/) instead of subdirectory (auth/paused/)
|
||||||
|
* because CLIProxyAPI's watcher uses filepath.Walk() which recursively scans
|
||||||
|
* all subdirectories of auth/. A sibling directory is completely outside
|
||||||
|
* CLIProxyAPI's scan path, preventing token refresh loops.
|
||||||
*/
|
*/
|
||||||
export function getPausedDir(): string {
|
export function getPausedDir(): string {
|
||||||
return path.join(getAuthDir(), 'paused');
|
return path.join(getCliproxyDir(), 'auth-paused');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user