-
Notifications
You must be signed in to change notification settings - Fork 15
feat: Add waiting room DO and courses flows across learner and host journeys #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,284 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!DOCTYPE html> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <html lang="en"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <head> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta charset="UTF-8" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <title>Activity - Alpha One Labs</title> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <link rel="icon" type="image/png" href="/images/logo.png" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script src="https://cdn.tailwindcss.com"></script> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script>tailwind.config = { theme: { extend: { colors: { brand:{ DEFAULT:'#4F46E5', dark:'#3730A3' } } } } };</script> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <style> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .hidden { display: none !important; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .gradient-hero { background: linear-gradient(135deg,#4F46E5 0%,#7C3AED 50%,#2563EB 100%); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .badge { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:.75rem; font-weight:600; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .danger-btn { border:1px solid #fca5a5; color:#b91c1c; background:#fff; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .danger-btn:hover { background:#fef2f2; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </style> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </head> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <body class="bg-slate-50 text-slate-800 font-sans"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <nav class="bg-white shadow-sm sticky top-0 z-50"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center justify-between h-16"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a href="/" class="flex items-center gap-2"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <img src="/images/logo.png" alt="Alpha One Labs" class="h-8 w-auto" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span class="font-bold text-xl text-slate-800">Alpha One Labs</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </a> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="nav-auth" class="flex items-center gap-3"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </nav> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="gradient-hero text-white py-12 px-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="max-w-7xl mx-auto"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="text-indigo-200 text-sm mb-3"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a href="/" class="hover:text-white">Activities</a> › <span id="crumb-title">Loading...</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h1 id="act-title" class="text-3xl font-extrabold mb-2">Loading...</h1> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p class="text-indigo-200 text-sm mb-4" id="act-meta"></p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="act-badges" class="flex flex-wrap gap-2 mb-5"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="act-action"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-col lg:flex-row gap-8"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Sidebar: details + sessions --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <aside class="lg:w-80 shrink-0 space-y-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- About card --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="bg-white rounded-2xl shadow-sm border border-slate-100 p-6"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h2 class="font-bold text-slate-800 text-sm mb-4">About this Activity</h2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p id="act-description" class="text-slate-500 text-sm leading-relaxed">Loading...</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="mt-4 space-y-2 text-sm" id="act-details"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="act-tags" class="flex flex-wrap gap-1.5 mt-4"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Sessions list --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden" id="sessions-card"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="px-5 py-4 border-b border-slate-100 flex items-center justify-between"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h2 class="font-bold text-slate-800 text-sm">Sessions</h2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span id="sessions-count" class="text-xs text-slate-400"></span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ul id="sessions-list" class="divide-y divide-slate-50 max-h-[50vh] overflow-y-auto"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <li class="px-5 py-4 text-sm text-slate-400">Loading...</li> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ul> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </aside> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Main content --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex-1 min-w-0"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Not joined CTA --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="join-cta" class="hidden bg-gradient-to-br from-indigo-50 to-purple-50 border border-indigo-100 rounded-2xl p-8 text-center mb-6"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p class="text-4xl mb-3">🔒</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h3 class="font-bold text-slate-800 text-lg mb-2">Join to access session details</h3> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p class="text-slate-500 text-sm mb-4">Session locations and descriptions are encrypted and only revealed to participants.</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <button id="btn-join" onclick="joinActivity()" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="bg-brand text-white font-bold px-8 py-2.5 rounded-xl hover:bg-brand-dark transition text-sm">Join Activity - Free</button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Participation card (shown when enrolled) --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="member-card" class="hidden bg-white rounded-2xl shadow-sm border border-slate-100 p-6 mb-6"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h2 class="font-bold text-slate-800 text-base mb-3">Your Participation</h2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-wrap gap-3 text-sm" id="enr-details"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Welcome card --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="welcome-card" class="bg-white rounded-2xl shadow-sm border border-slate-100 p-8"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h2 class="font-bold text-slate-800 text-lg mb-3">Welcome!</h2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p class="text-slate-500 text-sm leading-relaxed" id="welcome-text">Select an activity and join to see full details including session locations and descriptions.</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </main> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <footer class="bg-slate-800 text-slate-400 py-6 text-center text-sm mt-8"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p>© 2024–2026 Alpha One Labs · Session details encrypted at rest · <a href="/" class="hover:text-white">Home</a></p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </footer> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const API = ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function readAuthValue(key) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const fromSession = sessionStorage.getItem(key); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (fromSession) return fromSession; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const fromLocal = localStorage.getItem(key); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (fromLocal) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sessionStorage.setItem(key, fromLocal); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localStorage.removeItem(key); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return fromLocal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function clearAuth() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sessionStorage.removeItem('edu_token'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sessionStorage.removeItem('edu_user'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localStorage.removeItem('edu_token'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localStorage.removeItem('edu_user'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const token = readAuthValue('edu_token'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const user = JSON.parse(readAuthValue('edu_user') || 'null'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function esc(s) { return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function logout() { clearAuth(); window.location.href = '/login.html'; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Nav | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const nav = document.getElementById('nav-auth'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (token && user) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nav.innerHTML = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '<span class="text-slate-600 text-sm hidden sm:block">Hi, ' + esc(user.username) + '</span>' + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '<a href="/dashboard.html" class="bg-brand text-white text-sm font-semibold px-4 py-1.5 rounded-lg hover:bg-brand-dark transition">Dashboard</a>' + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '<button onclick="logout()" class="text-slate-400 text-sm hover:text-red-500">Logout</button>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nav.innerHTML = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '<a href="/login.html" class="text-slate-600 text-sm font-medium hover:text-brand">Login</a>' + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '<a href="/login.html?tab=register" class="bg-brand text-white text-sm font-semibold px-4 py-1.5 rounded-lg hover:bg-brand-dark transition">Register</a>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const typeIcon = { course:'📚', meetup:'🤝', workshop:'🔧', seminar:'🎤', other:'✨' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const typeColor = { course:'bg-indigo-100 text-indigo-700', meetup:'bg-pink-100 text-pink-700', workshop:'bg-orange-100 text-orange-700', seminar:'bg-teal-100 text-teal-700', other:'bg-slate-100 text-slate-600' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const fmtLabel = { live:'Live', self_paced:'Self-paced', hybrid:'Hybrid' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const fmtColor = { live:'bg-red-100 text-red-700', self_paced:'bg-emerald-100 text-emerald-700', hybrid:'bg-purple-100 text-purple-700' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const schedLabel = { one_time:'One-time', multi_session:'Multi-session', recurring:'Recurring', ongoing:'Ongoing' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const params = new URLSearchParams(location.search); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const actId = params.get('id'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async function deleteCourse() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!token) { window.location.href = '/login.html'; return; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!confirm('Delete this course and all its sessions? This cannot be undone.')) return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const res = await fetch('/api/activities/delete', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| method: 'POST', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body: JSON.stringify({ activity_id: actId }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const body = await res.json().catch(() => ({})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| window.location.href = '/courses.html'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+147
to
+154
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const res = await fetch('/api/activities/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ activity_id: actId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | |
| window.location.href = '/courses.html'; | |
| try { | |
| const res = await fetch('/api/activities/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ activity_id: actId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | |
| window.location.href = '/courses.html'; | |
| } catch (err) { | |
| alert(err && err.message ? err.message : 'Failed to delete course'); | |
| } |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteSession() has the same unhandled-error problem as deleteCourse(): it throws on failure but is called from an inline onclick, so the user gets no feedback if the API call fails. Wrap the body in try/catch and surface the error (alert/toast) rather than throwing.
| const res = await fetch('/api/activities/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ activity_id: actId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | |
| window.location.href = '/courses.html'; | |
| } | |
| async function deleteSession(sessionId) { | |
| if (!token) { window.location.href = '/login.html'; return; } | |
| if (!confirm('Delete this session?')) return; | |
| const res = await fetch('/api/sessions/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ session_id: sessionId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete session'); | |
| await loadActivity(); | |
| try { | |
| const res = await fetch('/api/activities/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ activity_id: actId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | |
| window.location.href = '/courses.html'; | |
| } catch (e) { | |
| alert(e.message || 'Failed to delete course'); | |
| } | |
| } | |
| async function deleteSession(sessionId) { | |
| if (!token) { window.location.href = '/login.html'; return; } | |
| if (!confirm('Delete this session?')) return; | |
| try { | |
| const res = await fetch('/api/sessions/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ session_id: sessionId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete session'); | |
| await loadActivity(); | |
| } catch (e) { | |
| alert(e.message || 'Failed to delete session'); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Async onclick handlers swallow errors silently.
deleteCourse() and deleteSession() are async and throw new Error(...) on non-OK responses, but they’re invoked via onclick="deleteCourse()" so the returned promise rejection becomes an unhandled-rejection warning with no user feedback — the user just sees "nothing happened". Wrap the fetch in try/catch and surface the message (matching the pattern already used in joinActivity at lines 271-274):
async function deleteCourse() {
if (!token) { window.location.href = '/login.html'; return; }
if (!confirm('Delete this course and all its sessions? This cannot be undone.')) return;
- const res = await fetch('/api/activities/delete', { ... });
- const body = await res.json().catch(() => ({}));
- if (!res.ok) throw new Error(body.error || 'Failed to delete course');
- window.location.href = '/courses.html';
+ try {
+ const res = await fetch('/api/activities/delete', { ... });
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok) throw new Error(body.error || 'Failed to delete course');
+ window.location.href = '/courses.html';
+ } catch (e) {
+ alert(e.message || 'Failed to delete course');
+ }
}Same for deleteSession.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| async function deleteCourse() { | |
| if (!token) { window.location.href = '/login.html'; return; } | |
| if (!confirm('Delete this course and all its sessions? This cannot be undone.')) return; | |
| const res = await fetch('/api/activities/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ activity_id: actId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | |
| window.location.href = '/courses.html'; | |
| } | |
| async function deleteSession(sessionId) { | |
| if (!token) { window.location.href = '/login.html'; return; } | |
| if (!confirm('Delete this session?')) return; | |
| const res = await fetch('/api/sessions/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ session_id: sessionId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete session'); | |
| await loadActivity(); | |
| } | |
| async function deleteCourse() { | |
| if (!token) { window.location.href = '/login.html'; return; } | |
| if (!confirm('Delete this course and all its sessions? This cannot be undone.')) return; | |
| try { | |
| const res = await fetch('/api/activities/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ activity_id: actId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete course'); | |
| window.location.href = '/courses.html'; | |
| } catch (e) { | |
| alert(e.message || 'Failed to delete course'); | |
| } | |
| } | |
| async function deleteSession(sessionId) { | |
| if (!token) { window.location.href = '/login.html'; return; } | |
| if (!confirm('Delete this session?')) return; | |
| try { | |
| const res = await fetch('/api/sessions/delete', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + token }, | |
| body: JSON.stringify({ session_id: sessionId }) | |
| }); | |
| const body = await res.json().catch(() => ({})); | |
| if (!res.ok) throw new Error(body.error || 'Failed to delete session'); | |
| await loadActivity(); | |
| } catch (e) { | |
| alert(e.message || 'Failed to delete session'); | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@public/course.html` around lines 144 - 168, deleteCourse and deleteSession
are async functions invoked from inline onclick handlers, so thrown errors
become unhandled promise rejections and give no user feedback; wrap the
fetch/response logic in each function in a try/catch (same pattern used in
joinActivity) and on error surface the message to the user (e.g.,
alert(err.message || 'Failed to delete course/session')) instead of throwing,
while preserving the existing redirects and successful-path behavior; update
both deleteCourse() and deleteSession(sessionId) accordingly.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,87 @@ | ||||||||||||||||||
| <!DOCTYPE html> | ||||||||||||||||||
| <html lang="en"> | ||||||||||||||||||
| <head> | ||||||||||||||||||
| <meta charset="UTF-8"/> | ||||||||||||||||||
| <meta name="viewport" content="width=device-width,initial-scale=1.0"/> | ||||||||||||||||||
| <title>Courses — Alpha One Labs</title> | ||||||||||||||||||
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"/> | ||||||||||||||||||
| <link rel="stylesheet" href="/waitingroom.css"/> | ||||||||||||||||||
| <style> | ||||||||||||||||||
| .page-inner{max-width:1100px;} | ||||||||||||||||||
| .page-header h1{font-size:24px;} | ||||||||||||||||||
| .courses-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;} | ||||||||||||||||||
| .course-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:16px 16px 14px;box-shadow:0 2px 10px rgba(0,0,0,.04);} | ||||||||||||||||||
| .course-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;} | ||||||||||||||||||
| .course-title{font-size:16px;font-weight:700;color:#111827;margin:0;} | ||||||||||||||||||
| .course-meta{margin-top:6px;color:#6b7280;font-size:13px;display:flex;gap:10px;flex-wrap:wrap;} | ||||||||||||||||||
| .pill{display:inline-flex;align-items:center;gap:6px;border:1px solid #e5e7eb;border-radius:999px;padding:2px 10px;font-size:12px;color:#374151;background:#f9fafb;} | ||||||||||||||||||
| .course-actions{display:flex;gap:8px;align-items:center;margin-top:12px;} | ||||||||||||||||||
| .btn-small{border:1px solid #0d9488;background:transparent;color:#0d9488;border-radius:6px;padding:6px 10px;font-size:12px;font-weight:700;cursor:pointer;font-family:'Inter',sans-serif;} | ||||||||||||||||||
| .btn-small:hover{background:#0d9488;color:#fff;} | ||||||||||||||||||
| .btn-ghost{border:1px solid #e5e7eb;color:#374151;background:#fff;} | ||||||||||||||||||
| .btn-ghost:hover{background:#f9fafb;color:#111827;border-color:#d1d5db;} | ||||||||||||||||||
| details{margin-top:12px;border-top:1px solid #eef2f7;padding-top:10px;} | ||||||||||||||||||
| summary{cursor:pointer;color:#111827;font-weight:700;font-size:13px;list-style:none;} | ||||||||||||||||||
| summary::-webkit-details-marker{display:none;} | ||||||||||||||||||
| .sessions{margin-top:10px;display:flex;flex-direction:column;gap:8px;} | ||||||||||||||||||
| .session{border:1px solid #e5e7eb;border-radius:8px;padding:10px 10px;background:#fff;} | ||||||||||||||||||
| .session-title{font-weight:700;font-size:13px;color:#111827;margin:0 0 4px;} | ||||||||||||||||||
| .session-sub{color:#6b7280;font-size:12px;} | ||||||||||||||||||
| .highlight{outline:3px solid rgba(99,102,241,.35);border-color:rgba(99,102,241,.5);} | ||||||||||||||||||
| .empty{color:#6b7280;font-size:14px;padding:18px;background:#fff;border:1px dashed #e5e7eb;border-radius:10px;} | ||||||||||||||||||
| @media(max-width:900px){.courses-grid{grid-template-columns:1fr;}} | ||||||||||||||||||
| </style> | ||||||||||||||||||
| </head> | ||||||||||||||||||
| <body> | ||||||||||||||||||
|
|
||||||||||||||||||
| <!-- NAV (same family as waitingroom.html) --> | ||||||||||||||||||
| <nav> | ||||||||||||||||||
| <a href="#" class="nav-logo"> | ||||||||||||||||||
| <img class="nav-logo-box" alt="Alpha One Labs logo" src="/images/logo.png"/> | ||||||||||||||||||
| Alpha One Labs | ||||||||||||||||||
| </a> | ||||||||||||||||||
| <div class="nav-links"> | ||||||||||||||||||
| <a href="#">LEARN ▾</a> | ||||||||||||||||||
| <a href="/courses.html">COURSES</a> | ||||||||||||||||||
| <a href="#">COMMUNITY ▾</a> | ||||||||||||||||||
| <a href="#">RESOURCES ▾</a> | ||||||||||||||||||
| <a href="#">ABOUT ▾</a> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div class="nav-search"> | ||||||||||||||||||
| <svg width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg> | ||||||||||||||||||
| <input type="text" placeholder="What do you want to learn?"/> | ||||||||||||||||||
| </div> | ||||||||||||||||||
|
Comment on lines
+50
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: search HTMLHint flags this one. A - <input type="text" placeholder="What do you want to learn?"/>
+ <input type="text" aria-label="Search courses" placeholder="What do you want to learn?"/>As per coding guidelines: "Review HTML templates for accessibility (ARIA attributes, semantic elements)..." 📝 Committable suggestion
Suggested change
🧰 Tools🪛 HTMLHint (1.9.2)[warning] 52-52: No matching [ label ] tag found. (input-requires-label) 🤖 Prompt for AI Agents |
||||||||||||||||||
| <div class="nav-icons"> | ||||||||||||||||||
| <button class="icon-btn" type="button">💬</button> | ||||||||||||||||||
| <button class="icon-btn" type="button" style="position:relative">🛒<span class="cart-badge">1</span></button> | ||||||||||||||||||
| <button class="icon-btn" type="button">🔔</button> | ||||||||||||||||||
| <button class="icon-btn" type="button">🌐</button> | ||||||||||||||||||
| <button class="icon-btn" type="button">🌙</button> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div class="nav-user" id="nav-user-menu" role="button" tabindex="0" aria-haspopup="true" aria-expanded="false"> | ||||||||||||||||||
| <div class="avatar-nav" id="nav-avatar">L</div> | ||||||||||||||||||
| <span id="nav-uname">...</span> ▾ | ||||||||||||||||||
| <div class="nav-user-dropdown" id="nav-user-dropdown"> | ||||||||||||||||||
| <button type="button" id="logout-btn">Logout</button> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </nav> | ||||||||||||||||||
|
|
||||||||||||||||||
| <div class="page"> | ||||||||||||||||||
| <div class="page-inner"> | ||||||||||||||||||
| <div class="page-header"> | ||||||||||||||||||
| <h1>Courses</h1> | ||||||||||||||||||
| <a class="btn-create" href="/teach.html">Create New Course</a> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div class="explainer"> | ||||||||||||||||||
| <h2>Browse created courses</h2> | ||||||||||||||||||
| <p>All published courses appear here. Expand a course to see its sessions.</p> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div id="courses" class="courses-grid"></div> | ||||||||||||||||||
| <div id="empty" class="empty" style="display:none;">No courses yet. Create one from a waiting room or the Host flow.</div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
|
|
||||||||||||||||||
| <script src="/courses.js"></script> | ||||||||||||||||||
| </body> | ||||||||||||||||||
| </html> | ||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esc()does not escape quotes — fine today, but it’s riding on UUID-only inputs.esconly replaces& < >, yet at line 214 you inject session ids into a single-quoted HTML attribute:Today
s.idis a server-generated UUID so there’s no exploit, but any future change that lets user-controlled text flow throughesc()into an attribute context becomes a stored-XSS foothold. Recommend hardeningesconce (defense in depth) rather than relying on upstream invariants:Bonus win: it then matches the
escapeHtmlused incourses.js/waitingroom.jsso a future shared auth/escape module is a copy-paste.As per coding guidelines: "Review HTML templates for ... XSS risks from unescaped user content."
🤖 Prompt for AI Agents