Skip to content

Conversation

sviluppomania
Copy link

A failed authentication on /token no more returns an HTML message.

Before this commit, the /token endopoint was returning thw Wordpress default error for a failed login. This was an HTML string with a link to recover the password.

Dealing with REST API it's better to always have plain text as a message

A failed authentication on /token no more returns an HTML message.

Before this commit, the /token endopoint was returning thw Wordpress default error for a failed login. This was an HTML string with a link to recover the password.

Dealing with REST API it's better to always have plain text as a message
@sun sun added the needs tests Automated tests should be adjusted in './tests' label May 18, 2022
'statusCode' => 401,
'code' => $error_code,
'message' => strip_tags( $user->get_error_message( $error_code ) ),
'message' => strip_tags('Authentication failed: '.$error_code),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing code removes HTML tags already, so I'm not sure what this PR actually changes (other than removing a potentially more helpful error message for the end-user)…?

@sun sun removed the needs tests Automated tests should be adjusted in './tests' label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants