mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 11:54:33 +03:00
Removed POST signin functionality
no-issue This is no longer needed as we can signin with a GET now
This commit is contained in:
parent
73bc3ec388
commit
162ff4e0bf
@ -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, '');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user