yp.go 540 B

1234567891011121314151617181920
  1. package admin
  2. import (
  3. "net/http"
  4. "github.com/owncast/owncast/controllers"
  5. "github.com/owncast/owncast/core/data"
  6. log "github.com/sirupsen/logrus"
  7. )
  8. // ResetYPRegistration will clear the YP protocol registration key.
  9. func ResetYPRegistration(w http.ResponseWriter, r *http.Request) {
  10. log.Traceln("Resetting YP registration key")
  11. if err := data.SetDirectoryRegistrationKey(""); err != nil {
  12. log.Errorln(err)
  13. controllers.WriteSimpleResponse(w, false, err.Error())
  14. return
  15. }
  16. controllers.WriteSimpleResponse(w, true, "reset")
  17. }