Verify new profiles from the profile directory, not the project directory - #3
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
vcx profile login appto --forceinside~/Work/00-Current/prosty-ukladcompleted the browser login, then vcx printed:Vercel CLI 59 changed
whoami: it callsgetScope(client, { resolveLocalScope: true }), which reads.vercel/project.jsonin 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 plainvercel whoamifailure right aftervcx profile use apptoin 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 whoamiinside a project linked to another team will still sayNot authorizedfor an account outside that team. That is Vercel's behaviour, not vcx's.🤖 Generated with Claude Code