mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
Handled 204 API response for logged out member session
refs https://github.com/TryGhost/Team/issues/560 The endpoint `/members/api/session/` is used by Portal for fetching member session while setting up and redirecting to Stripe Checkout flow. The status code returned by API for logged out member is changed from 4xx Unauthorized to 204 No Content, which is consistent with member API response.
This commit is contained in:
parent
7578a9cec4
commit
ac33b47e7f
@ -44,7 +44,7 @@ function setupGhostApi({siteUrl = window.location.origin}) {
|
|||||||
url,
|
url,
|
||||||
credentials: 'same-origin'
|
credentials: 'same-origin'
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
if (!res.ok) {
|
if (!res.ok || res.status === 204) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return res.text();
|
return res.text();
|
||||||
|
Loading…
Reference in New Issue
Block a user