Conversation
maidul98
left a comment
There was a problem hiding this comment.
Let's remove the errors specific to CLI and keeps the generic ones
There was a problem hiding this comment.
Backend changes look good but for CLI, a better approach is to make use of PersistentPreRun function in the root CMD. You can call a function there and it will get run by every child command.
What we want to check for is if there is a token over ride either from --token flag or from environment. If we see them being set we can show the message. Here is a example
maidul98
left a comment
There was a problem hiding this comment.
Made minor adjustment to the error warning message and removed the comments. Let’s only add comments for very nuanced logic
maidul98
left a comment
There was a problem hiding this comment.
source would be better set as a enum of sorts because now the get token function is tightly coupled with the warning logic but this is fine for now
Description 📣
API:
This PR adds more descriptive error messages for certain errors. Specifically we are now formatting JWT-related errors, so they're more understandable for the end users.
CLI:
We are now checking if the user is using user-based auth, and token based auth at the same time. If the user is using both token-based and user-based authentication, we will display a warning letting the user know that the token-based auth is being used.
This has been confusing users in the past, so this aims to add more clarity which authentication method is being used.
After talking to @maidul98, this seemed like something we'd want to keep on the API-end, instead handling directly in the CLI codebase.
Type ✨