Wednesday, July 6, 2022
Let’s say you want to login to your work account with the vercel CLI, but you use a different browser for work. Now the CLI would open the personal browser by default and voila, you’re now logged into your personal account. So what do you do?
It’s a common problem. You want to login to your work account with the vercel CLI, and you use a different browser for work all the time (easy to have everything logged in there). I personally use Google Chrome for my day-to-day personal use and Firefox for work. I have been suggested to use the profile switching options offered by most browsers these days, but for some reason they’re not as smooth as having two different browsers - easy mental model as well.
Back from the detour, whenever I’d want to log in to any CLI service (be it Vercel, GitHub or otherwise) I’d have to spend quite some time to login to the right account (with hacky ways of course.)
TIL there’s a better approach to this one. Using the out-of-band mode. Most CLIs offer something similar. This one’s from Vercel docs for example:
As written there, when doing this, one gets the verification link right in the terminal and then it’s up to the users to put the link in whichever browser they want. Maybe this should’ve been the default for all CLIs, because afaik every single “developer” has got both work and a personal profile. Or depending on projects, might have different accounts for different ones. Regardless, still good that this out-of-band mode exists, or else life would continue to suck.
No fluff. No spam. Unsubscribe any time.
Every Saturday I share some high-quality insights from across the web, directly to you. Here's what you can expect: