mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Renamed login middleware to getIdentityToken
no-issue This name `login` was misleading as this middleware didn't login members, that was handled by the `authentication` middleware, specifically `exchangeTokenForSession`
This commit is contained in:
parent
419e12d90a
commit
046bd652e5
@ -4,7 +4,7 @@ const shared = require('../../web/shared');
|
||||
const labsService = require('../labs');
|
||||
const membersService = require('./index');
|
||||
|
||||
const login = async function (req, res) {
|
||||
const getIdentityToken = async function (req, res) {
|
||||
try {
|
||||
const token = await membersService.ssr.getIdentityTokenForMemberFromSession(req, res);
|
||||
res.writeHead(200);
|
||||
@ -82,9 +82,9 @@ module.exports = {
|
||||
exchangeTokenForSession,
|
||||
decorateResponse
|
||||
],
|
||||
login: [
|
||||
getIdentityToken: [
|
||||
shared.middlewares.labs.members,
|
||||
login
|
||||
getIdentityToken
|
||||
],
|
||||
logout: [
|
||||
shared.middlewares.labs.members,
|
||||
|
@ -119,7 +119,7 @@ module.exports = function setupSiteApp(options = {}) {
|
||||
|
||||
// Members middleware
|
||||
// Initializes members specific routes as well as assigns members specific data to the req/res objects
|
||||
siteApp.get('/members/ssr', membersMiddleware.login);
|
||||
siteApp.get('/members/ssr', membersMiddleware.getIdentityToken);
|
||||
siteApp.delete('/members/ssr', membersMiddleware.logout);
|
||||
siteApp.post('/members/webhooks/stripe', membersMiddleware.stripeWebhooks);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user