Repository navigation
feat: let moderators require a login before attendees can post messages - #245
Open
junkerderprovinz wants to merge 1 commit into
Open
junkerderprovinz wants to merge 1 commit into
junkerderprovinz wants to merge 1 commit into
Conversation
junkerderprovinz
force-pushed
the
feature/require-login-for-messages
branch
4 times, most recently
from
September 11, 2026 17:03
4a64d51 to
1a18699
Compare
junkerderprovinz
force-pushed
the
feature/require-login-for-messages
branch
2 times, most recently
from
October 2, 2026 01:18
af4410f to
8d5f4c9
Compare
junkerderprovinz
force-pushed
the
feature/require-login-for-messages
branch
from
October 15, 2026 10:51
8d5f4c9 to
b4a8371
Compare
junkerderprovinz
force-pushed
the
feature/require-login-for-messages
branch
2 times, most recently
from
October 28, 2026 22:59
1d451e2 to
b617a19
Compare
Adds a per-event switch on the attendees options: with it on, only signed-in attendees can post to the message wall. Everyone can still read, and every other interaction is unaffected. The state lives on presentation_states, defaulting to false, so existing events keep their current behaviour. The rule is enforced in Claper.Posts: create_attendee_post/3 refuses a message from an attendee who is not signed in while the event requires a login, so it holds for every caller rather than only for the rendered composer. The LiveView clause and the composer markup follow the same rule, and the disabled composer carries no leftover nickname or identity fields. Attendees who are not signed in see why the composer is gone and get a log in link that returns them to the event they came from, checked as a local path so it cannot be pointed elsewhere. Turning the switch on or off takes effect for everyone already in the room, and the moderator's own toggle is refused server-side when the chat is off, not merely disabled in markup.
junkerderprovinz
force-pushed
the
feature/require-login-for-messages
branch
from
November 18, 2026 19:20
b617a19 to
1781e39
Compare
This branch has not been deployed
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.
What it does
Adds a moderator switch to the attendees options, "Require login to post" (keyboard shortcut F), which restricts the message wall to signed-in attendees. Reading messages, reactions, polls, forms and quizzes stay open to everyone.
The switch is a boolean column on
presentation_stateswith a default offalse, so existing events and existing posts are unaffected and keep the behaviour they have today.How it is enforced
Claper.Posts.create_post/3takes the author as its own argument and puts:user_idon the changeset from it; the field is not cast from the submitted attributes, so a payload naming somebody else's account is ignored. Without an author the changeset is refused whenPresentations.authenticated_chat_only?/1returns true, and that reads the current row from the database rather than a presentation state the caller mounted earlier. The LiveView clause and the composer markup follow the same rule.ClaperWeb.PostController.create/2answers422with the changeset errors; it has no route and always builds a post without an author, so while the setting is on every call to it is refused.Who may post only means something while messages are on at all, so
update_presentation_state/2refuses a change toanonymous_chat_enabledorauthenticated_chat_onlywhilechat_enabledis false. One update that switches messages on and changes who may post in the same push is accepted. The manage view renders both toggles disabled while messages are off and flashes an error if a push arrives regardless.An attendee without a session gets a log in prompt in place of the composer, pointing at
/users/log_in?return_to=/e/<code>, and the identity menu is rendered only with the composer, so it goes away with it. The session controller keeps that parameter only when it is a same origin path, so the link cannot be aimed at another host or at a path thatredirect/2would reject.Tests cover the context rule, the toggle guard, the gated composer and the return path, including an attendee holding a state loaded before the moderator flipped the switch.