heroku-accounts
heroku-accounts copied to clipboard
Frequently logs me out
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.
Used to work fine but now I have to re-authorize every time I switch accounts 😞 .
Any news on that?
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)
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.
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
Thank you @dentarg !! That fixed it. For anyone finding this issue in the future:
- Get your API Key for each account
- Go to https://dashboard.heroku.com/account
- Navigate to where the auth config file is stored
cd ~/.config/heroku/accounts(if not there, it'll becd ~/.heroku/accounts)
- Edit the specific account file and set the password to be your API Key for each account
open <account name>(account name fromheroku accounts)
- 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.