Require authentication to participate in chat (#4762)
* feat(chat): require authentication to participate in chat * fix: it's pretty much impossible to bypass the auth requirement, addressing review feedback anyway * feat(chat): render chat text input as disabled if chat auth is required * Commit updated API documentation --------- Co-authored-by: Owncast <owncast@owncast.online>
This commit is contained in:
@@ -14,9 +14,17 @@ export type ChatModalProps = {
|
||||
messages: ChatMessage[];
|
||||
currentUser: CurrentUser;
|
||||
handleClose: () => void;
|
||||
inputEnabled?: boolean;
|
||||
inputDisabledPlaceholder?: string;
|
||||
};
|
||||
|
||||
export const ChatModal: FC<ChatModalProps> = ({ messages, currentUser, handleClose }) => {
|
||||
export const ChatModal: FC<ChatModalProps> = ({
|
||||
messages,
|
||||
currentUser,
|
||||
handleClose,
|
||||
inputEnabled = true,
|
||||
inputDisabledPlaceholder,
|
||||
}) => {
|
||||
if (!currentUser) {
|
||||
return null;
|
||||
}
|
||||
@@ -58,6 +66,8 @@ export const ChatModal: FC<ChatModalProps> = ({ messages, currentUser, handleClo
|
||||
chatUserId={id}
|
||||
isModerator={isModerator}
|
||||
chatAvailable
|
||||
inputEnabled={inputEnabled}
|
||||
inputDisabledPlaceholder={inputDisabledPlaceholder}
|
||||
focusInput={false}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user