fix(chat): invitation email hook paths and redirect flow#1512
Open
kkopanidis wants to merge 1 commit into
Open
fix(chat): invitation email hook paths and redirect flow#1512kkopanidis wants to merge 1 commit into
kkopanidis 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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