Skip to content
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

Inform the user that they need to use HTTPS instead of HTTP when usage of HTTP is the problem. #331

Open
dominiquemariano opened this issue Mar 25, 2024 · 0 comments
Assignees

Comments

@dominiquemariano
Copy link

Is your feature request related to a problem? Please describe.
The request below returns the following error: code: 'llms_rest_unauthorized_request', message: 'Sorry, you are not allowed to create an enrollment as this user.', when you are using HTTP.

curl "http://lms.local/wp-json/llms/v1/students/2/enrollments/66" \
  -X POST \
  -H "authorization: Basic Y2tfYmFkNzg1ODg4NDEyNTJmYzU5OTI0MzQ0NWY0YzVmZTcwYzlkMjE1OTpjc184ZDNkYTIzNGIwNGY3MWEyN2QwYWI3MGQ0YjUxN2M2Y2JjNDNmY2Zj" 

However, when the same code uses HTTPS as seen below, the error disappears.

curl "https://lms.local/wp-json/llms/v1/students/2/enrollments/66" \
  -X POST \
  -H "authorization: Basic Y2tfYmFkNzg1ODg4NDEyNTJmYzU5OTI0MzQ0NWY0YzVmZTcwYzlkMjE1OTpjc184ZDNkYTIzNGIwNGY3MWEyN2QwYWI3MGQ0YjUxN2M2Y2JjNDNmY2Zj" 

Describe the solution you'd like
The error message should make it clear that the user should be using HTTPS instead of HTTP when the usage of HTTP is the source of the problem.

Describe alternatives you've considered
None.

Requesting customerr
https://wordpress.org/support/topic/how-to-enroll-user-using-the-rest-api/

@ideadude ideadude moved this to Awaiting Triage in Development Mar 25, 2024
@ideadude ideadude self-assigned this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting Triage
Development

No branches or pull requests

2 participants