Gate admin routes behind auth and add copy guest link button
When auth is enabled, admin pages require the logged-in user to be the event owner — unauthorized visitors get redirected to the guest view, and admin actions return 403. Also adds a copy-to-clipboard button in the admin bar and a Makefile for common commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<meta name="twitter:image" content="{{.BaseURL}}/e/{{.Event.Slug}}/og.png">
|
||||
{{end}}
|
||||
|
||||
{{define "admin-bar"}}{{if .IsAdmin}}<div class="admin-bar">ADMIN VIEW — share the guest link: /e/{{.Event.Slug}}</div>{{end}}{{end}}
|
||||
{{define "admin-bar"}}{{if .IsAdmin}}<div class="admin-bar">ADMIN VIEW — <button onclick="navigator.clipboard.writeText(window.location.origin+'/e/{{.Event.Slug}}').then(()=>{this.textContent='Copied!';setTimeout(()=>{this.textContent='Copy guest link'},1500)})" style="background:none;border:none;font-family:inherit;font-size:inherit;cursor:pointer;text-decoration:underline;color:inherit;">Copy guest link</button></div>{{end}}{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div class="event-header">
|
||||
|
||||
Reference in New Issue
Block a user