Skip to content

Verify new profiles from the profile directory, not the project directory - #3

Merged
akrupa-appto merged 1 commit into
mainfrom
verify-neutral-cwd
Sep 2, 2026
Merged

Verify new profiles from the profile directory, not the project directory#3
akrupa-appto merged 1 commit into
mainfrom
verify-neutral-cwd

Conversation

@akrupa-appto

Copy link
Copy Markdown
Collaborator

Problem

vcx profile login appto --force inside ~/Work/00-Current/prosty-uklad completed the browser login, then vcx printed:

vcx: Vercel rejected the profile: Error: Not authorized

Vercel CLI 59 changed whoami: it calls getScope(client, { resolveLocalScope: true }), which reads .vercel/project.json in the working directory and switches the scope to that project's team. The appto account is not a member of the team prosty-uklad is linked to, so the team lookup returned 403 and vcx threw the new login away. The same thing explains the earlier plain vercel whoami failure right after vcx profile use appto in that directory.

Fix

Verification (vercel whoami) now runs with the profile directory as its working directory. That directory never holds a project link, so the check only depends on the token. Regression test covers a linked project in cwd.

Plain vercel whoami inside a project linked to another team will still say Not authorized for an account outside that team. That is Vercel's behaviour, not vcx's.

🤖 Generated with Claude Code

…tory

Vercel CLI 59 resolves the team for `whoami` from a linked project in the
working directory. Running `vcx profile login` inside a project linked to a
team the new account is not in failed with 'Not authorized' even though the
login itself succeeded. Verification now runs with the profile directory as
cwd, which never holds a project link.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@akrupa-appto
akrupa-appto merged commit bd34c65 into main Sep 2, 2026
28 checks passed
@akrupa-appto
akrupa-appto deleted the verify-neutral-cwd branch September 2, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant