xataio / vscode-extension

Use Xata without leaving Visual Studio Code.
Apache License 2.0
7 stars 1 forks source link

Login with existing API key #47

Closed kostasb closed 2 years ago

kostasb commented 2 years ago

When clicking the Login button on the Xata: Explorer I am always directed to the page "New API key for Xata VSCode extension". Once I log out I have no option in the UI to log back in with an existing key. It would be great to provide an option "Login with existing API key".

Also, for this purpose, when creating an API key for the extension it would be great to expose it to the user so they can keep it to log back in. This way the user won't need to sign in to their Xata app account on a browser session every time they would like to login to the Xata VS Code extension.

fabien0102 commented 2 years ago

Thanks for the feedback!

You can actually already log with an existing key image But since this is not the "prefered flow", this is not on the main flow and there just as backup plan if something doesn't work 😁

For the idea of exposing the key to the user… I see why you want this but the idea is more that you log only one time and that's it (and this is the same for our CLI). Also it's a best practice to not share token between usages, so if one token is corrupted, you can granulary revoked it.

Maybe, what you want, is a way to select an existing token instead of creating a new one in the app.xata.io (but this can only regenerate the token, for security reasons)

kostasb commented 2 years ago

Thanks @fabien0102 , great to see the option to Login with token already exists and can be accessed in Settings -> Command Palette -> > Xata: Login with token.

Hint: After installing the extension for the first time, VS Code might need to be restarted for the command to run successfully. To me, this command was available in the palette list but when I run it I received an error popup. It was resolved after restarting Visual Studio.

image

kostasb commented 2 years ago

Since there is a method to login with API key as mentioned above, I will go ahead and close this. Thanks!