-
Notifications
You must be signed in to change notification settings - Fork 187
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
Improve UX for unverified accounts on CLI #751
Comments
Thanks for the contribution JCK. |
I would be excited to open a PR for this as my first issue. Should I follow any guidelines? |
Hi @b-hass. There are no specific guidelines outside if the readme. I think this will involve changes both to hex and hexpm API. |
Hi @supersimple, thanks for the reply. Wouldn't a call to the current Lines 171 to 182 in c12ebc3
What would we need to change in the hexpm API? |
@b-hass yes, that might work. I was assuming there would be changes in the API, but you make a good point. Let me know if you need help once you get started. 💛 |
We shouldn't hit the API endpoint directly when fetching dependencies because the API is less reliable than the repository and doesn't have the same ability as the repository to handle peaks of 1000 requests/sec. So unfortunately calling Looking into this issue more it seems more complex than we first anticipated, the current behavior is dictated by the interaction of four different systems: the client, API server, our CDN, and S3. To authenticate requests for private packages the CDN does a cached preflight request to the authentication endpoint on the API [1] to verify the access. The authentication endpoint on the API actually returns an error response that includes the reason why the request failed (unverified email, not a valid API key, etc.). The CDN unfortunately hides this response, the reason being that it is by default JSON encoded and this client doesn't have a JSON library. The client could set Additionally we don't display the error message on the client either, the reason being that the error message from the S3 bucket is confusing to most users [2]. We might be able to hide this response on the CDN instead. In the future we may want to change the authentication for private packages so that we do not hit the API at all and instead move to a static system that does not rely on the availability of the API. It's hard to imagine a static authentication system that can check if the user's email is verified so the best solution may be to drop this check completely. [1] https://github.com/hexpm/hexpm/blob/master/lib/hexpm_web/controllers/api/auth_controller.ex#L7 |
When creating a new account on hex.pm and running
mix hex.user auth
, there is no mention of the verification email in the CLI feedback. For example:This feedback leads me to believe that I can readily be added to organizations and then download their dependencies, for example:
But when running
mix deps.get
against a project in said organization, I get a failure with the message:Debugging, using
mix hex.user whoami
reveals the problem:It would be helpful for new users coming to the platform to make this email verification step more transparent through the CLI by doing one or both:
mix hex.user auth
and onmix deps.get
failures, provide clear messaging about verification stepEven if the second one were implemented, the first would still be helpful in instances where an email address was changed and needed to be re-verified.
The text was updated successfully, but these errors were encountered: