Security & UX Update: Custom session codes, admin session take-over, secure presentation tokens, and SVG/CSS branding assets
This commit is contained in:
@@ -21,7 +21,8 @@ function PresentApp() {
|
||||
useEffect(() => {
|
||||
const code = location.hash.replace('#', '');
|
||||
const params = new URLSearchParams(location.search);
|
||||
const token = params.get('token');
|
||||
// Accept both ?pt= (present token) and ?token= (legacy/admin password)
|
||||
const token = params.get('pt') || params.get('token');
|
||||
|
||||
if (!code || !token) {
|
||||
setPhase('need-config');
|
||||
@@ -176,18 +177,12 @@ function PresentApp() {
|
||||
<h2 className="text-3xl font-bold text-center mb-6">{question?.frage}</h2>
|
||||
{question?.bild && <img src={question.bild} className="max-h-48 mx-auto rounded-xl mb-6" alt="" />}
|
||||
|
||||
{/* Answer options with feedback colors + vote counts */}
|
||||
{question?.typ?.toLowerCase() !== 'freitext' && (
|
||||
<div className="grid grid-cols-2 gap-4 mb-8">
|
||||
{(question?.antworten || []).map((a) => {
|
||||
const isCorrect = correctKeys.has(a.key);
|
||||
const count = result?.stats?.[a.key] || 0;
|
||||
let cls;
|
||||
if (isCorrect) {
|
||||
cls = 'bg-green-600 ring-4 ring-green-400';
|
||||
} else {
|
||||
cls = 'bg-gray-700 opacity-50';
|
||||
}
|
||||
const cls = isCorrect ? 'bg-green-600 ring-4 ring-green-400' : 'bg-gray-700 opacity-50';
|
||||
return (
|
||||
<div key={a.key} className={`${cls} rounded-2xl p-6 text-2xl font-bold flex items-center justify-between`}>
|
||||
<span>{isCorrect ? '✓ ' : ''}{a.text}</span>
|
||||
@@ -206,7 +201,6 @@ function PresentApp() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Leaderboard */}
|
||||
<div className="flex-1">
|
||||
<h3 className="text-2xl font-bold text-center mb-4">🏆 Leaderboard</h3>
|
||||
<div className="max-w-xl mx-auto">
|
||||
|
||||
Reference in New Issue
Block a user