Removed POST signin functionality

no-issue

This is no longer needed as we can signin with a GET now
This commit is contained in:
Fabien O'Carroll 2019-09-16 16:00:16 +08:00
parent 73bc3ec388
commit 162ff4e0bf
2 changed files with 1 additions and 26 deletions

View File

@ -118,19 +118,3 @@ Array.prototype.forEach.call(document.querySelectorAll('[data-members-signout]')
}
el.addEventListener('click', clickHandler);
});
var magicLinkRegEx = /token=([a-zA-Z0-9_\-]+\.[a-zA-Z0-9_\-]+\.[a-zA-Z0-9_\-]+)/;
var match = location.search.match(magicLinkRegEx);
var isMagicLink = !!match
var token = match && match[1];
if (isMagicLink) {
fetch('{{blog-url}}/members/ssr', {
method: 'POST',
body: token
}).then(function (res) {
if (res.ok) {
window.location.search = window.location.search.replace(magicLinkRegEx, '');
}
});
}

View File

@ -142,16 +142,7 @@ module.exports = function setupSiteApp(options = {}) {
res.end(err.message);
});
});
siteApp.post('/members/ssr', shared.middlewares.labs.members, function (req, res) {
membersService.ssr.exchangeTokenForSession(req, res).then(() => {
res.writeHead(200);
res.end();
}).catch((err) => {
common.logging.warn(err.message);
res.writeHead(err.statusCode);
res.end(err.message);
});
});
siteApp.delete('/members/ssr', shared.middlewares.labs.members, function (req, res) {
membersService.ssr.deleteSession(req, res).then(() => {
res.writeHead(204);