Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

401 should be returned rather than 403 if logged out (in some places) #757

Copy link
Copy link

Description

@rmccue
Issue body actions

Right now, we return a 403 in a lot of places, but we actually should return a 401 if no authentication is provided. This doesn't apply to all 403s, but it does apply to quite a few.

I'd suggest we add a function for this, so we could simply switch to:

return new WP_Error( 'error_code', __( 'Error message' ), 'status' => json_authorization_required() );

with something like:

function json_authorization_required() {
    return is_user_logged_in() ? 403 : 401;
}
Reactions are currently unavailable

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.