Invite link should not auto-accept invitation if user is already logged in

AI-generated summary

A user, mcwumbly, reported an issue with the invite link feature in Discourse. When a user is already logged in, clicking an invite link intended for another user’s email address still accepts the invitation. mcwumbly suggested displaying a warning dialog in such cases, prompting the user to log out and try again.

@codinghorror acknowledged the issue and assigned it to techAPJ, who fixed the problem via a GitHub commit. mcwumbly pointed out a minor punctuation error in the warning dialog, which was corrected by techAPJ in a subsequent GitHub commit.

I’ve been using the Copy Invite Link features for invites primarily because I find it a lot more natural to personally craft a message to people who I am inviting to a topic (especially people who are not yet users).

Recently, I was typing up an email and when I added the link, I was kindly prompted by Gmail to test the URL:

The dialog in Discourse states that the “Invite link is only valid for this email address”:

Unfortunately, after clicking it, even though I was already logged in as myself, it appeared to immediately accept the invitation.

If a user is already logged in who is not the one who created the invite it could instead display a warning dialog saying something to the effect of “oops, looks like you are attempting to accept an invitation for another user. If you are not [logged in user], please log out and try again?”

7 إعجابات

Sure @techapj can you add this to your list?

3 إعجابات

Okay, done via:

https://github.com/discourse/discourse/commit/1253afdf959051b84d15d37e133dc7875ef520cb


4 إعجابات

:thumbsup: Small nitpick. Seems like that ? at the end be a . instead.

4 إعجابات

https://github.com/discourse/discourse/commit/72784d23e7e0c4950b01cf31189bea2337b6118f

3 إعجابات