-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve authentication logging and warnings #645
fix: improve authentication logging and warnings #645
Conversation
🦋 Changeset detectedLatest commit: 26a709b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2009312857/npm-package-wrangler-645 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/645/npm-package-wrangler-645 Or you can use npx https://prerelease-registry.developers.workers.dev/runs/2009312857/npm-package-wrangler-645 dev path/to/script.js |
@@ -365,6 +372,13 @@ function throwIfNotInitialised() { | |||
|
|||
export function getAPIToken(): string | undefined { | |||
throwIfNotInitialised(); | |||
if (LocalState.api_token) { | |||
console.warn( | |||
"It looks like you have used Wrangler 1's `config` command to login with an API token.\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tempted to just ignore the field and proceed as if the user isn't logged in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what we do at the moment, and it was causing confusion. See #526
Hence this PR.
22f6e40
to
0708070
Compare
- If a user has previously logged in via Wrangler 1 with an API token, we now display a helpful warning. - When logging in and out, we no longer display the path to the internal user auh config file. - When logging in, we now display an initial message to indicate the authentication flow is starting. Fixes [cloudflare#526](cloudflare#526)
0708070
to
26a709b
Compare
Fixes #526