fix(chat): invitation email hook paths and redirect flow#1512
fix(chat): invitation email hook paths and redirect flow#1512kkopanidis wants to merge 1 commit into
Conversation
Email invitation links hit a hook that required an authenticated user and returned plain text instead of redirecting. Align the registered hook path with email URLs, allow optional auth on the hook, and redirect unauthenticated users to login with a return URL while sending authenticated users to configurable accept/decline destinations.
be7f03e to
824e160
Compare
Bugs and Unintended Side Effects1. Missing Membership Cache InvalidationSeverity: Medium — real user impact
Fix: Clear Severity: Minor — not blockers 2. Missing Validation in Authenticated
|
Problem
Chat invitation emails link to
/hook/chat/invitations/{accept|decline}/{token}, but the hook handler required an authenticated user in request context and returned a plain string response. Users clicking email links while logged out hit a broken flow with no redirect to login or back into the app.Solution
/hook/chat/invitations/:answer/:invitationTokento match email URLs (Hermes already prefixes module hooks, but the route is now explicit).authMiddleware?so the hook works for anonymous email-link visits.explicit_room_joins.redirect.login_uriwithredirectUriset to the hook URL so they can return after login.accept_uri/decline_uriare configured ({roomId}placeholder supported).buildInvitationHookUrlshared by email templates and the hook handler.Config
Set via Chat module config (
explicit_room_joins.redirect):login_uriaccept_uri{roomId})decline_uriTest plan
login_uri?redirectUri=<hook url>accept_uridecline_uri