diff src/chat.html.luan @ 24:87fe70201aa8

courses work
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 31 Jul 2025 22:30:26 -0600
parents 820136c5ee33
children 3a80ddafe5a4
line wrap: on
line diff
--- a/src/chat.html.luan	Wed Jul 30 23:29:33 2025 -0600
+++ b/src/chat.html.luan	Thu Jul 31 22:30:26 2025 -0600
@@ -7,17 +7,14 @@
 local header = Shared.header or error()
 local started = Shared.started or error()
 local User = require "site:/lib/User.luan"
-local current_user = User.current or error()
+local current_user = User.current_required or error()
 local Chat = require "site:/lib/Chat.luan"
 local get_chat_by_id = Chat.get_by_id or error()
 
 
 return function()
 	local user = current_user()
-	if user == nil then
-		Http.response.send_redirect("/login.html")
-		return
-	end
+	if user == nil then return end
 	local chat_id = Http.request.parameters.chat or error()
 	local chat = get_chat_by_id(chat_id) or error()
 	Io.stdout = Http.response.text_writer()