Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Wrangler Login should print the URL to the console in addition to opening it #1544

Closed
kentonv opened this issue Sep 4, 2020 · 2 comments · Fixed by #1611
Closed

Wrangler Login should print the URL to the console in addition to opening it #1544

kentonv opened this issue Sep 4, 2020 · 2 comments · Fixed by #1611
Labels
good first issue Good for newcomers

Comments

@kentonv
Copy link
Member

kentonv commented Sep 4, 2020

wrangler login opens a browser window to the Cloudflare dashboard in order to generate a token.

Some folks, like me, have multiple browser profiles. Opening a browser using the default mechanism doesn't necessarily use the correct profile.

Unfortunately, the URL that wrangler login opens seems to immediately redirect to something else, such that if I copy/paste the URL out of the address bar and into the correct browser profile, it doesn't work as expected.

Most tools like this also print the URL to the terminal, so that it can be copy/pasted. It would be great if Wrangler did so as well. It would be especially great if it did so even if I chose "no" when asked "Allow Wrangler to open a page in your browser?"

@kentonv
Copy link
Member Author

kentonv commented Sep 4, 2020

So I ended up replacing xdg-open on my system with this shell script:

#! /bin/bash

echo -n "$1" | xsel -i -b
echo "URL COPIED: $1"
notify-send "URL Copied" "$1"

TBH I should have done this a LONG time ago! This is just all-around better for me across a lot of programs. Heh.

So I don't need this change anymore but I still think it would be a good idea for others. Most other terminal programs that open browser windows print the URL in my experience.

@encadyma
Copy link
Contributor

encadyma commented Oct 22, 2020

Hey there! As a WSL user, I came across the same issue just today. I'd love to take a swing at this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants