Ghost/ghost/core/test/e2e-frontend
Simon Backx 75bb53f065
🔒 Added support for logging out members on all devices (#18935)
fixes https://github.com/TryGhost/Product/issues/3738
https://www.notion.so/ghost/Member-Session-Invalidation-13254316f2244c34bcbc65c101eb5cc4

- Adds the transient_id column to the members table. This defaults to
email, to keep it backwards compatible (not logging out all existing
sessions)
- Instead of using the email in the cookies, we now use the transient_id
- Updating the transient_id means invalidating all sessions of a member
- Adds an endpoint to the admin api to log out a member from all devices
- Added the `all` body property to the DELETE session endpoint in the
members API. Setting it to true will sign a member out from all devices.
- Adds a UI button in Admin to sign a member out from all devices
- Portal 'sign out of all devices' will not be added for now

Related changes (added because these areas were affected by the code
changes):
- Adds a serializer to member events / activity feed endpoints - all
member fields were returned here, so the transient_id would also be
returned - which is not needed and bloats the API response size
(`transient_id` is not a secret because the cookies are signed)
- Removed `loadMemberSession` from public settings browse (not used
anymore + bad pattern)

Performance tests on site with 50.000 members (on Macbook M1 Pro):
- Migrate: 6s (adding column 4s, setting to email is 1s, dropping
nullable: 1s)
- Rollback: 2s
2023-11-15 17:10:28 +01:00
..
helpers Fixed Tier events being created when Posts are edited 2022-09-05 17:19:27 +01:00
advanced_url_config.test.js Prevent simple error logs by stubbing log library 2023-03-03 18:25:53 +00:00
custom_routes.test.js 🐛 Fixed sitemaps with no content (#15571) 2022-10-12 14:11:19 +01:00
default_routes.test.js Added Source as the new default theme 2023-10-03 14:02:08 +02:00
email_routes.test.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00
member_stats.test.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00
members.test.js 🔒 Added support for logging out members on all devices (#18935) 2023-11-15 17:10:28 +01:00
preview_routes.test.js 🐛 Redirected email previews to /email/ route (#18976) 2023-11-14 13:31:41 -06:00