fix(ui): read the correct localStorage key for USER-scope always-approve

This commit is contained in:
matevip 2026-07-23 14:59:08 +08:00
parent e2747df2c5
commit 130112c5bf

View File

@ -2103,7 +2103,10 @@ async function handleApproveAlways(
} else if (payload.scope === 'AGENT') {
scopeId = String(currentAgent.value?.id ?? '')
} else if (payload.scope === 'USER') {
const me = localStorage.getItem('mc-user-id')
// Login persists the id under 'userId' (see Login.vue); the old 'mc-user-id'
// key was never written, so USER-scope always-approve silently failed to
// resolve a scopeId and fell back to a one-shot /approve without a grant.
const me = localStorage.getItem('userId')
if (me) scopeId = me
}
if (!scopeId) {