5

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.

Jacob Phillips
  • 8,841
  • 3
  • 51
  • 66

2 Answers2

10

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

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
0

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.

mrpaint
  • 468
  • 3
  • 6