Closed TejasQ closed 2 years ago
Changing the title because xata auth login
works as expected. This command only touches the credentials file, because it's a command for global mode, not project mode.
By design, an API key in an .env
file will always take precedence over the api key in the credentials file. The reason is that in the near future you may have both but with different scopes, being the one in the .env
file scoped to the database and thus preferred by operations done in the current database.
So, we'll just provide additional debug information in the error message, to at least let the user know where the API key is obtained from.
I feel like GitHub should add 💯 to the emoji reactions. If it did, I’d react with that. Thanks!
Describe the bug
Loom: https://www.loom.com/share/4612e5d993014dfc99b4ac797a58a56e
xata init
always fails withInvalid API key
when.env
is present and contains an older API key, despite runningxata auth login
and provide a new API key.To Reproduce
.env
in your current project with a stale API keyxata auth login
xata init
Expected behavior
xata auth login
, after successfully logging in, checks if there's an existing stale API key in.env
and warns that this will still be used, with the choice to override it.Software version
@xata.io/cli/0.7.0 darwin-arm64 node-v16.15.1
Additional Context