Skip to content

Commit 55a0b55

Browse files
committed
Merge pull request WP-API#18 from WP-API/fix-error-response
Don't override error responses from other handlers
2 parents 642360e + 195ee0f commit 55a0b55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/class-wp-json-authentication-oauth1.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,14 @@ public function authenticate( $user ) {
186186
/**
187187
* Report authentication errors to the JSON API
188188
*
189+
* @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not
189190
* @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication}
190191
*/
191-
public function get_authentication_errors() {
192+
public function get_authentication_errors( $value ) {
193+
if ( $value !== null ) {
194+
return $value;
195+
}
196+
192197
return $this->auth_status;
193198
}
194199

0 commit comments

Comments
 (0)