refactor(server/api): migrate admin_smtp/admin_tracks + playlist refresh preludes (A2 6/N)

This commit is contained in:
2026-05-08 10:18:35 -04:00
parent 9dd5da514c
commit bf90a3a868
4 changed files with 6 additions and 13 deletions
+3 -4
View File
@@ -52,11 +52,10 @@ func (h *handlers) handleRemoveTrack(w http.ResponseWriter, r *http.Request) {
}
}
admin, ok := auth.UserFromContext(r.Context())
// Defensive: RequireUser+RequireAdmin should have run upstream. If
// we got here without a user in context the routing is broken.
admin, ok := requireUser(w, r)
if !ok {
// Defensive: RequireUser+RequireAdmin should have run upstream.
// If we got here without a user in context the routing is broken.
writeErr(w, apierror.Unauthorized("unauthenticated", "no session"))
return
}