heroku-accounts icon indicating copy to clipboard operation
heroku-accounts copied to clipboard

Frequently logs me out

Open kapso opened this issue 7 years ago • 6 comments
trafficstars

Is it just me, or everyone else gets frequently logged out as well. Basically I have to login to an account after every few days.

kapso avatar Sep 06 '18 18:09 kapso

Used to work fine but now I have to re-authorize every time I switch accounts 😞 .

alistairholt avatar Aug 16 '19 09:08 alistairholt

Any news on that?

sobrinho avatar Mar 16 '20 18:03 sobrinho

Workaround temp.py

account_name=
account_name2=
mail=
pwd=

cmd=[

f'heroku accounts:set {account_name2}',
f'heroku accounts:remove {account_name}',
f'heroku accounts:add {account_name}',
]
import subprocess
for cmd in cmds:subprocess.run(cmd)

SmartManoj avatar Sep 12 '21 15:09 SmartManoj

Is this still affecting anyone else? Every time I switch it logs me out.

I can't tell if I'm using this wrong, but I'm assuming so since it would defeat the purpose if I have to heroku login each time.

kvenn avatar Mar 12 '24 01:03 kvenn

I'm using this plugin to switch between accounts and it is still working well, but I've learned that I need to curate the API key for my accounts manually, not use the Heroku CLI to sign in

If you prepare the config directory, heroku accounts:set <account> should work well.

See this article for more info about the different types of API keys Heroku have and how to create them manually: https://help.heroku.com/PBGP6IDE/how-should-i-generate-an-api-key-that-allows-me-to-use-the-heroku-platform-api

dentarg avatar Mar 12 '24 14:03 dentarg

Thank you @dentarg !! That fixed it. For anyone finding this issue in the future:

  1. Get your API Key for each account
    • Go to https://dashboard.heroku.com/account
  2. Navigate to where the auth config file is stored
    • cd ~/.config/heroku/accounts (if not there, it'll be cd ~/.heroku/accounts)
  3. Edit the specific account file and set the password to be your API Key for each account
    • open <account name> (account name from heroku accounts)
  4. You're done!

Bonus

Have it auto switch based on directory

https://github.com/heroku/heroku-accounts/issues/27#issuecomment-733528868

⚠️ Note

Read this to understand how the API Key works.

kvenn avatar Mar 12 '24 23:03 kvenn