rustc -V: n/anode -v: v14.8.0wrangler -V: 👷 ✨ wrangler 1.10.3wrangler.tomlwrangler login
Authenticate Wrangler with your Cloudflare login. This will prompt you with a Cloudflare account login page and is the alternative to wrangler config.
❯ wrangler login
error: Found argument 'login' which wasn't expected, or isn't valid in this context
USAGE:
wrangler [SUBCOMMAND]
For more information try --help
wrangler login is only available on wrangler version >=1.11.0, which is currently a pre-release. See https://github.com/cloudflare/wrangler/releases, and you can try the new version with npm i @cloudflare/wrangler@beta -g.
It looks like 1.11.0 is due for release really soon though 👀 https://github.com/cloudflare/wrangler/pull/1513
@Cherry is correct, we're aiming to release 1.11.0 tomorrow, which will bring both login and dev out of beta. Looks like we jumped the gun adding login to the docs, apologies!
Ah that makes sense!
I can confirm that after updating to the latest release, the wrangler login command works as described.
doesn't work on macOS, opens automatically Safari, token created and there is no way to get it working. even with the beta version
Reproduced this, unintentionally. wrangler login was working for me before. Now, a token is created but my terminal hangs ⠤ Waiting for API token.... Going to investigate further.
Edit: The temporary fix is to go to your https://dash.cloudflare.com/profile/api-tokens and delete the existing Wrangler Login API tokens. I'll have to make changes on our end so that we stop creating new tokens if you've got an active one.
~@nataliescottdavidson's solution of deleting the old wrangler token worked for me.~ It's no longer working and the workarounds won't work for me unfortunately. I've tried uninstalling and reinstalling, as well as with a new version of npm/node/wrangler, blowing away all my API keys, etc.
On macOS, deleting the old tokens is not worked for me as @nataliescottdavidson's said.
Instead this I created token manually using "Edit Cloudflare Workers" template. And then it successfully logged in with
wrangler config
On macOS, deleting the old tokens is not worked for me as @nataliescottdavidson's said.
Instead this I created token manually using "Edit Cloudflare Workers" template. And then it successfully logged in with
wrangler config
Same. It just hangs on Waiting for API token... after the token is created. Manually creating a token then using it on wrangler config worked. Thanks 👍 !
Wrangler login now rolls the existing token instead of creating a new one. You may need to delete the old tokens which have accumulated.
wrangler login doesn't work on git version 2.25.1.windows.1 (git bash) and wrangler 1.11.0 even with workarounds. Token is created as seen on dashboard but the terminal hangs indefinitely with Waiting for API token....
wrangler logindoesn't work ongit version 2.25.1.windows.1(git bash) andwrangler 1.11.0even with workarounds. Token is created as seen on dashboard but the terminal hangs indefinitely withWaiting for API token....
Sorry to hear that... have you navigated to https://dash.cloudflare.com/profile/api-tokens on your account and verified that you have deleted existing "Wrangler Login" tokens?
wrangler logindoesn't work ongit version 2.25.1.windows.1(git bash) andwrangler 1.11.0even with workarounds. Token is created as seen on dashboard but the terminal hangs indefinitely withWaiting for API token....Sorry to hear that... have you navigated to https://dash.cloudflare.com/profile/api-tokens on your account and verified that you have deleted existing "Wrangler Login" tokens?
As per my comment I've tried even the workarounds which includes deleting existing "Wrangler Login" tokens.
I also had 'wrangler login' hang, waiting/polling for the token.
The token was being created. Deleting it and retrying did not work.
Workaround:
Delete any existing token.
Log out via the browser.
Log in using the tab opened by Wrangler.
... worked for me.
I had the same issue, unfortunately the solution described by @tebb didn't work for me.
After I tried to configure wrangler with "wrangler config" I needed the API token but I couldn't find it.
Whilst trying to figure the token out I figured out that I couldn't update any existing token with the dashboard. Always got this error: "API Request Failed: PUT /api/v4/user/tokens/xyz (500)" Why does that happen?
This was my solution:
Now it says "Successfully configured".
I've just tried for the first time ever (so no prior tokens whatsoever) and my terminal also hangs with "waiting for api token" forever (VS Code)
Same using
$ wrangler --version
👷 ✨ wrangler 1.12.2
tebb's solution did not work for me.
wrangler 1.12.2 stuck at Waiting for API token... after authentication
No work arounds above work. Tried this on a laptop which has never used Wrangler before.
same problem. macOS Big Sur. no token existed before. safari opened, token was created, but terminal is stuck.
Same problem (Ubuntu 18.04 x64, installed wrangler using cargo 1.48.0, not using sys openssl), wrangler hangs on Waiting for API token (API token is generated successfully though).
Workaround for me: roll the generated API token and configure it manually using wrangler config.
I'm having issues with wrangler dev not working with wrangler config and wondered if it would make a difference using wrangler login, but I just get this stuck Waiting for API token... even though the browser (Firefox) shows that I can close the window because the token has been created.
This is the other issue I'm seeing that led me to try using wrangler login instead: https://github.com/cloudflare/wrangler/issues/1583
I also tried deleting the token I created manually and the new token to try again but it still just hangs forever waiting.
wrangler --version: wrangler 1.12.3
OS = Ubuntu 20.04.1 LTS
From the pov that wrangler dev doesn't currently work when logged in using wrangler config then then wrangler config isn't a workaround for me but for all I know i'd see the same result if wrangler login was working (I was specifically trying to investigate if there was a subtle difference with wrangler login vs wrangler config)
Most helpful comment
doesn't work on macOS, opens automatically Safari, token created and there is no way to get it working. even with the beta version