0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/server
Fabien O'Carroll a701ee7023
Added support for token session to /ghost (#11709)
no-issue

* Added default for getting origin of request

This function is used to attach the origin of the request to the
session, and later check that requests using the session are coming from
the same origin. This protects us against CSRF attacks as requests in
the browser MUST originate from the same origin on which the user
logged in.

Previously, when we could not determine the origin we would return
null, as a "safety" net.

This updates the function to use a secure and sensible default - which
is the origin of the Ghost-Admin application, and if that's not set -
the origin of the Ghost application.

This will make dealing with magic links simpler as you can not always
guaruntee the existence of these headers when visiting via a hyperlink

* Removed init fns and getters from session service

This simplifies the code here, making it easier to read and maintain

* Moved express-session initialisation to own file

This is complex enough that it deserves its own module

* Added createSessionFromToken to session service

* Wired up the createSessionFromToken middleware
2020-04-06 11:49:14 +02:00
..
adapters Refactored existing adapters to use adapter-manager 2020-04-05 21:13:47 +02:00
api Removed typo 2020-03-25 12:28:57 +00:00
config Refactored existing adapters to use adapter-manager 2020-04-05 21:13:47 +02:00
data Removed unused timezones.json file 2020-03-30 18:43:59 +01:00
lib Replaced mobiledoc cards with @tryghost/kg-default-cards 2020-03-25 19:54:11 +00:00
models Remove External Apps 2020-03-20 10:40:22 +00:00
public Added minified members.js file handling 2020-02-26 14:08:10 +08:00
services Added support for token session to /ghost (#11709) 2020-04-06 11:49:14 +02:00
translations Remove External Apps 2020-03-20 10:40:22 +00:00
views Update default 404 page 2019-07-15 14:47:01 +02:00
web Added support for token session to /ghost (#11709) 2020-04-06 11:49:14 +02:00
analytics-events.js Added event to integrations when created (#10588) 2019-03-11 15:28:17 +01:00
ghost-server.js Added debug info to controller process messages 2020-04-06 10:44:39 +01:00
index.js Refactored existing adapters to use adapter-manager 2020-04-05 21:13:47 +02:00
overrides.js
sentry.js Switched Sentry to use helper file for Ghost version 2020-03-26 15:35:46 +00:00
update-check.js Added site URL to Update Check body 2020-03-09 09:48:04 +00:00