Skip to content

Commit 670d2f9

Browse files
rekram1-nodegithub-actions[bot]
authored andcommitted
tweak: hide MCP access token prefix (anomalyco#33711)
1 parent 970d275 commit 670d2f9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/opencode/src/cli/cmd

packages/opencode/src/cli/cmd/mcp.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,9 @@ export const McpDebugCommand = effectCmd({
708708
prompts.log.info(`Auth status: ${getAuthStatusIcon(authStatus)} ${getAuthStatusText(authStatus)}`)
709709

710710
if (entry?.tokens) {
711-
prompts.log.info(` Access token: ${entry.tokens.accessToken.substring(0, 20)}...`)
711+
prompts.log.info(
712+
` Access token: ${entry.tokens.accessToken.length > 8 ? `${entry.tokens.accessToken.slice(0, 4)}***${entry.tokens.accessToken.slice(-4)}` : "***"}`,
713+
)
712714
if (entry.tokens.expiresAt) {
713715
const expiresDate = new Date(entry.tokens.expiresAt * 1000)
714716
const isExpired = entry.tokens.expiresAt < Date.now() / 1000

0 commit comments

Comments
 (0)