-
-
Notifications
You must be signed in to change notification settings - Fork 819
gleam hex authenticate
must be run twice to switch accounts.
#4319
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
Comments
Ah! Thank you. The build tool assumes that the token is for the same account as the previous one, and then tries to use it to invalidate the old token. We should not try to invalidate in that case, but what should we do instead? |
I would gladly work on this. My proposal would be to add a new Because of the name of the operation being "deauthenticate" there should be no confusion to which username/password we are referring to. (Which I think is the source of this particular issue). In addition to this, if the token can not be invalidated, show a warning instead of an error. Finally, if the user runs In the long run I guess the best would be to support multiple accounts. @lpil Do you think this would be something of interest? |
That command could be useful, but I think that's not quite the same thing as solving this problem. I think we need to start storing the name of the user and the name of the API key with the API key itself so we can tell if we are able to revoke it or not. We'll need to decide what the behaviour should be for the authenticate command. Perhaps if the name doesn't match we could print a message telling the programmer to do it themselves and giving a link to the Hex page? |
that makes sense, I will come with something more concrete in the form of a PR in the upcoming days. thanks for the hints! |
If you hold multiple hex accounts, you might want to replace the local token gleam uses to interact with the hex api from time to time. This consistently fails when changing account details and must always be run a second time to succeed.
Steps to reproduce:
gleam hex authenticate
for the first time to generate a local token for hex account Agleam hex authenticate
a second time, confirm that you would like to replace the local token, and provide different credentials for hex account Bgleam hex authenticate
a third time exactly the same as aboveYou can continue to confirm the issue by attempting to authenticate with hex account A again and observe you must go through the command twice more.
The text was updated successfully, but these errors were encountered: