Ghost/core/server/services/members
Rishabh 196cdafe6b 💡 Removed 401 error for logged-out member on Portal
closes https://github.com/TryGhost/Team/issues/560
closes https://github.com/TryGhost/Ghost/issues/12870

The endpoint `/members/api/member/` is used by Portal for fetching member details on site load to setup different flows. The response from this endpoint for logged out member has now changed from 401 Unauthorized to 204 No Content.

Ghost API was previously returning 401 Unauthorized error for logged-out member as this seemed to be technically correct response for unauthorized access to membership features. This resulted in a lot of confusion for end users where visible 401 errors on console were perceived as errors in the script as well as caught by loggers as erroneous traffic. Also for an end user, in the context of visiting a website - the user themselves is not trying to gain access to anything so this becomes cause for more confusion.

After internal discussion, the endpoint - [SITE_URL]/members/api/member- now returns 204 No Content instead of 401 for logged out member, denoting server was able to process the request but did not find any associated member. This should avoid any unwanted error logging on Portal load on a site, as well as make Portal functioning more transparent for a site.
2021-05-13 15:26:07 +05:30
..
emails Added extra settings to member auth emails (#12238) 2020-10-01 12:31:36 +05:30
importer Made complimentary_plan & stripe_customer_id exclusive 2021-05-11 12:33:28 +01:00
stats Added jsdoc to MembersStats class 2021-01-14 12:59:17 +13:00
api.js Passed Settings model to @tryghost/members-api 2021-05-03 13:59:13 +01:00
config.js Updated stripe_plans & portal_plans settings 2021-05-07 16:31:08 +01:00
content-gating.js Added support for gating content by member labels and products (#12946) 2021-05-10 19:32:11 +01:00
index.js Expanded requires of lib/common i18n and events 2021-05-03 17:14:52 +01:00
middleware.js 💡 Removed 401 error for logged-out member on Portal 2021-05-13 15:26:07 +05:30
settings.js 🐛 Fixed Admin redirect for newsletter/support email update (#12810) 2021-03-23 11:24:07 +05:30
SingleUseTokenProvider.js Updated magic links to use shorter, single us, longer lived tokens (#12218) 2020-09-18 17:32:18 +01:00
stripe-connect.js Encoded the mode in the Stripe Connect OAuth state 2020-06-10 14:06:57 +02:00
utils.js Fixed paid flag on members 2021-02-25 14:26:41 +00:00