Ghost/core/server/services
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
..
adapter-manager Added base and default SSO Adapter 2020-04-05 21:13:47 +02:00
auth Added support for token session to /ghost (#11709) 2020-04-06 11:49:14 +02:00
bulk-email Captured bulk-email errors in Sentry 2020-03-04 13:44:23 +00:00
invitations Refactored authentication controller v0.1 (#10893) 2019-07-17 12:28:16 +02:00
mail Allowed localhost email for Ghost Mailer "from" address (#11476) 2020-01-13 12:58:53 +05:30
mega 🐛 Fixed missing publication icon in newsletter emails 2020-03-12 09:52:54 +05:30
members Added minified members.js file handling 2020-02-26 14:08:10 +08:00
permissions Remove External Apps 2020-03-20 10:40:22 +00:00
settings Added new brand blog setting (#11408) 2019-12-17 16:15:31 +05:30
webhooks Added member.edited webhook 2019-10-31 14:34:50 +00:00
labs.js Updated syntax in labs service 2019-11-06 14:53:53 +07:00
slack.js Added missing semicolon 2020-03-26 16:45:33 +00:00
xmlrpc.js 🏗 Migrated posts.page column to posts.type (#11111) 2019-09-16 11:51:54 +01:00