Major Update, registration and authentication of devices works now.

This is the first iteration of the registration of devices and authentication for a couple of endpoints.
This needs to be refactored, the code is a bit of a mess. Also because of testing some endpoints are available for remotes that shouldn't be.
This commit is contained in:
Jesse Malotaux 2025-04-04 11:27:19 +02:00
parent 193ce6c8f1
commit b598a090bc
12 changed files with 308 additions and 49 deletions

View file

@ -63,10 +63,10 @@ func ListMacros(w http.ResponseWriter, r *http.Request) {
func DeleteMacro(w http.ResponseWriter, r *http.Request) {}
func PlayMacro(w http.ResponseWriter, r *http.Request) {
var req structs.MacroRequest
func PlayMacro(data string, w http.ResponseWriter, r *http.Request) {
req := &structs.MacroRequest{}
_, err := helper.ParseRequest(req, data, r)
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return