Commit Graph

39856 Commits

Author SHA1 Message Date
Djordje Vlaisavljevic
f214213859 Improved how we handle Like notifications
ref https://linear.app/ghost/issue/AP-480/handle-likes-received-on-replies

- Clicking a notification now opens Article/Note in the drawer
- When the liked post is a reply, the content of the reply is shown in the notification
2024-10-22 15:42:25 +01:00
Djordje Vlaisavljevic
936ff85efb Updated welcome screen copy and link
ref https://forum.ghost.org/t/activitypub-beta-start-here/51780
2024-10-22 15:42:25 +01:00
Djordje Vlaisavljevic
7e7aee92c5 Removed Comment button in drawer view
ref https://linear.app/ghost/issue/AP-498/remove-items-from-post-view-in-sidebar
2024-10-22 15:42:25 +01:00
Djordje Vlaisavljevic
51913a7990 Removed button for resizing the drawer
ref https://linear.app/ghost/issue/AP-498/remove-items-from-post-view-in-sidebar
2024-10-22 15:42:25 +01:00
Djordje Vlaisavljevic
797a34f9e2 Removed static Unfollow button from Following tab
ref https://linear.app/ghost/issue/AP-499/remove-unfollow-buttons-from-following-tab-on-your-profile
2024-10-22 15:42:25 +01:00
Djordje Vlaisavljevic
8846cb9d19 Removed static Delete button from the dropdown
ref https://linear.app/ghost/issue/AP-420/i-can-see-a-delete-action-on-posts-that-are-not-mine
2024-10-22 15:42:25 +01:00
Djordje Vlaisavljevic
ba43678964 Fixed z-index issue
ref https://linear.app/tryghost/issue/AP-464/feed-view-refinements
2024-10-22 15:42:25 +01:00
renovate[bot]
eb85af051f Update tiptap monorepo to v2.9.0 2024-10-22 13:57:37 +00:00
Michael Barrett
e75de41eac
Filtered out non-follower activities on home feed of the admin-x-activitypub app (#21362)
refs
[AP-477](https://linear.app/ghost/issue/AP-477/incorrect-posts-in-home-feed)

Filtered out non-follower activities on home feed of the
`admin-x-activitypub` app
2024-10-22 14:42:43 +01:00
Michael Barrett
f7fbb6edcd
Moved ActivityPub labs flag to (private) beta (#21363)
no refs
2024-10-22 12:45:45 +01:00
Cathy Sarisky
1ce5dc34ca
🐛 fixed routing error when no recommendations (#21251)
no ref.

The default routing for the portal app is a signup page. When a site has
no recommendations, the result of triggering that page (by following a
link that goes there) is a prompt to sign up, or a notification that one
cannot sign up, if membership is disabled.

This patch adds a "No recommendations" message, which will be shown if a
user follows a recommendations link (#/portal/recommendations) on a site
without recommendations. While we shouldn't end up there very often,
it'll make a lot more sense when it does!
2024-10-22 11:34:44 +01:00
Djordje Vlaisavljevic
7bc510f1c9 Bumped admin-x-activitypub to 0.1.5
no ref
2024-10-22 10:57:58 +01:00
Djordje Vlaisavljevic
6bc933f149 Fixed breakpoint for large screens
ref https://linear.app/tryghost/issue/AP-464/feed-view-refinements
2024-10-22 10:57:58 +01:00
Djordje Vlaisavljevic
5af25e1433 Bump admin-x-activitypub to 0.1.4
no ref
2024-10-22 09:33:40 +01:00
Michael Barrett
2f70d29baa
Reverted revert of reply filtering in admin-x-activitypub (#21357)
no refs
2024-10-22 09:33:34 +01:00
Djordje Vlaisavljevic
7c32527159
Updated ActivityPub design (#21327)
ref https://linear.app/ghost/issue/AP-476/remove-static-buttons-from-notifications-and-resolve-css-issues, https://linear.app/ghost/issue/AP-449/remove-follow-button-and-component, https://linear.app/ghost/issue/AP-448/add-loading-state-for-home-tab, https://linear.app/ghost/issue/AP-446/update-top-nav-bar-design

- Added the Suggestions sidebar
- Added real data to `Your profile` tab
- Switched navigation in top-bar to text-based
- Added loading states to Home and Activity tabs
- Fixed overflow and z-index CSS issues
- Removed `Unfollow` modal since now have a more user-friendly way to follow users
- Changed link color to blue
2024-10-21 20:24:36 +01:00
Michael Barrett
4277c2a9d5
Reverted reply filtering in admin-x-activitypub (#21355)
refs
[TryGhost/Ghost#21258](https://github.com/TryGhost/Ghost/pull/21258)

Reverted reply filtering in `admin-x-activitypub` that was added in as a
temporary fix
2024-10-21 16:06:52 +01:00
Daniël van der Winden
66a78dc2b1
Fixed history action icons (#21354)
fixes
https://linear.app/ghost/issue/DES-784/action-icons-have-wrong-z-index-are-hidden-beneath-user-avatars

Action icons next to each item in History were obscured by the staff
user's avatar. This fix resolves that.
2024-10-21 14:42:40 +00:00
Kevin Ansfield
a4e3ef012c Improved validation behaviour on 2fa code verification screen
closes https://linear.app/ghost/issue/ENG-1672

- removed input on-blur validation because it can be triggered when clicking reset button giving a misleading error state
- added client-side validation for 6-digit code
- added validation when submitting the form
- added error reset when typing in the code field, including removal of button failure state, so it's clearer you're in a new submit state
2024-10-21 12:32:29 +01:00
Kevin Ansfield
6c4de6a937 Updated 2fa flow copy
closes https://linear.app/tryghost/issue/ENG-1654
closes https://linear.app/tryghost/issue/ENG-1656
closes https://linear.app/tryghost/issue/ENG-1657

- updated copy
- improved error handling when verification fails
- refactored some duplication of steps in Admin authentication tests
2024-10-21 11:01:40 +01:00
Sam Lord
85d305ebf7 Added browser tests for 2fa 2024-10-21 11:01:40 +01:00
Kevin Ansfield
2bf626bf6c Added explicit 2fa required error detection
no issue

- previously we determined any 403 response was an indication that we should switch to the 2fa input screen during sign-in
- added a custom error that explicitly looks for an error with our `2FA_TOKEN_REQUIRED` code so we don't have any confusion when a non-2fa 403 is received for any reason and to have the option of moving away from the 403 if needed without breaking the client
- test to ensure our error 2fa-required error detection works correctly
- extracted duplicate steps in the authentication tests into a helper function
- fixed authentication tests so they better represent our API output of `errors` being an array
2024-10-21 11:01:40 +01:00
Kevin Ansfield
df6eb7bfda Fixed flash of button error state when redirected to 2fa screen
closes https://linear.app/tryghost/issue/ENG-1652/

- returning `undefined` from a task is equivalent to failing
- switched to returning `true` when we get the 2fa required error so the button stays in the neutral/success state
- added `SUCCESS` and `FAILURE` consts to better reflect control flow when returning from tasks and ensured we always return a value
2024-10-21 11:01:40 +01:00
Sam Lord
3ed1f6a8ca Added tests for sessions API with 2fa enabled 2024-10-21 11:01:40 +01:00
Sam Lord
eef6c64131 Added brute protection to 2FA endpoints
ref ENG-1629

Use separate protection for the 2 endpoints as one can resend an
email, and the other is used to login -- each presents its own
security challenges.
2024-10-21 11:01:40 +01:00
Michael Barrett
d90a70e43c Moved 2fa resend button inside form and added countdown 2024-10-21 11:01:40 +01:00
Sam Lord
c9c8709fd3 Added publication icon to 2fa email if available 2024-10-21 11:01:40 +01:00
Princi Vershwal
d2ca6e4a74 Added siteLogo to session service emails 2024-10-21 11:01:40 +01:00
Djordje Vlaisavljevic
548ff8d14a Updated design for 2FA verification code email
ref https://linear.app/tryghost/issue/ENG-1636/email-template-design-for-verification-code-email
2024-10-21 11:01:40 +01:00
Princi Vershwal
0c0ac6f0ab Changed subject for verification code email 2024-10-21 11:01:40 +01:00
Princi Vershwal
5ee2f91557 Added support for fetching device details when creating session 2024-10-21 11:01:40 +01:00
Michael Barrett
29d1026606 Added button to resend 2fa code
refs [ENG-1644](https://linear.app/tryghost/issue/ENG-1644/add-re-send-ui-flow)
2024-10-21 11:01:40 +01:00
Sam Lord
1f687ae466 Moved 2fa labs flag usage to avoid logging out users
After migrations run, any sessions made with the labs flag turned off
will have the verified flag set. We also need new sessions made after
that to gain the verified flag, so that they aren't logged out at the
point that the labs flag is enabled (or removed).
2024-10-21 11:01:40 +01:00
Michael Barrett
16b0ef352f Fixed 2fa code resend button reverting to retry on success
refs [ENG-1642](https://linear.app/tryghost/issue/ENG-1642/when-submitting-the-code-the-login-button-changes-to-retry-before)
2024-10-21 11:01:40 +01:00
Sam Lord
db107bd789 Fixed sendAuthCodeForUser to find user on first request
ref ENG-1641

Using `getUserFromSession` requires the cookie header to be set, but
at this point we may still be constructing the session. Instead we can
get the user id from the session itself
2024-10-21 11:01:40 +01:00
Princi Vershwal
3cffb9a132 Moved session verified check behind staff2fa flag 2024-10-21 11:01:40 +01:00
Sam Lord
cb8d18423a Fixed login / logout with 2fa code
refs ENG-1640

We had built all the right pieces, but the session endpoints weren't
verifying the service
2024-10-21 11:01:40 +01:00
Princi Vershwal
3bf0b7d8ed Added sending of 2fa code email on sign in 2024-10-21 11:01:40 +01:00
Michael Barrett
58269c879b Added migration for session verification field 2024-10-21 11:01:40 +01:00
Sam Lord
296a2be2d8 Fixed the snapshot test for the e2e suite 2024-10-21 11:01:40 +01:00
Sam Lord
f772008c69 Prevent regression / e2e tests from trying to use 2fa 2024-10-21 11:01:40 +01:00
Kevin Ansfield
1a05652b50 Added 2fa token verification error handling
closes https://linear.app/tryghost/issue/ENG-1635

# Conflicts:
#	ghost/admin/app/controllers/signin-verify.js
2024-10-21 11:01:40 +01:00
Sam Lord
5f192344f8 Switched to 1 token per minute, 10 tokens accepted
More typical in TOTP setups for each token to last 1 minute, and to
allow some older tokens.

Also moved the options setting out of the generate scope in case
verify is called first (unlikely but possible).
2024-10-21 11:01:40 +01:00
Michael Barrett
8a86db4ea5 Updated response code for re-sending verification 2024-10-21 11:01:40 +01:00
Michael Barrett
916b2aef9d Added tests for auth code middleware 2024-10-21 11:01:40 +01:00
Sam Lord
0b852bcb38 Added check for verified sessions
refs ENG-1610
2024-10-21 11:01:40 +01:00
Michael Barrett
7a18e829c5 Added endpoints for supporting 2FA
no refs

- Added `POST /session/verify` to send the user a verification code
- Added `PUT /session/verify` to verify the user's verification code
2024-10-21 11:01:40 +01:00
Princi Vershwal
51fa21324d Added logic for generating and verifying otp 2024-10-21 11:01:40 +01:00
Princi Vershwal
1106d64706 Added API for sendingAuthCode 2024-10-21 11:01:40 +01:00
Kevin Ansfield
68af12cfad Added 2fa happy path to Admin
closes https://linear.app/tryghost/issue/ENG-1617/
closes https://linear.app/tryghost/issue/ENG-1619/

- updated cookie authenticator's `authenticate` method to accept an `{identification, pasword, token}` object
  - if `token` is provided, hit our `PUT /session/verify/` endpoint passing through the token instead of hitting the `POST /session/` endpoint
- added `signin/verify` route
  - displays a 2fa code input field, including required attributes for macOS auto-fill from email/messages to work
  - uses `session.authenticate({token})` when submitted
- updated signin routine to detect token-required state
  - detects a `403` response with a `2FA_TOKEN_REQUIRED` code property when authenticating
  - if detected transitions to the `signin/verify` route
2024-10-21 11:01:40 +01:00