fixed twitch authentication
This commit is contained in:
@@ -3,6 +3,7 @@ package twitch
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type addUserReq struct {
|
||||
@@ -26,3 +27,14 @@ func MonitorUserHandler(m *Monitor) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func GetMonitoredUsers(m *Monitor) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
it := m.GetMonitoredUsers()
|
||||
|
||||
if err := json.NewEncoder(w).Encode(slices.Collect(it)); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user