Skip to content

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

@dominiquemariano

Description

@dominiquemariano

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/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Awaiting Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions