Jacob Phillips
Jacob Phillips

Reputation: 9274

How can I logout of Dart Pub CLI?

I published a package and logged into the wrong account. I corrected the uploaders by using

flutter packages pub uploader add <correct email>
flutter packages pub uploader remove <incorrect email>

But now when I try to push an update I am unauthorized because I'm still logged in as the incorrect email.

Upvotes: 5

Views: 818

Answers (2)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657801

There should be a file

~/.pub-cache/credentials.json

that holds your current authentication info.
If you remove that you should be requested to login again.

Update

A pub logout command was just added https://github.com/dart-lang/pub/pull/2035

Upvotes: 10

Son Dao
Son Dao

Reputation: 502

If you are using Flutter SDK, the .pub-cache directory is actually inside the flutter directory. For my laptop, I have downloaded Flutter into /home/username/flutter: in order to reset credentials for commands like flutter packages pub publish, I had to delete /home/username/flutter/.pub-cache.

Upvotes: 0

Related Questions