owncast/webserver/handlers/admin/yp.go
Gabe Kangas 0b5d7c8a4d
Config repository (#3988)
* WIP

* fix(test): fix ap test failing

* fix: fix unkeyed fields being used

* chore(tests): clean up browser tests by splitting out federation UI tests
2024-11-15 19:20:58 -08:00

21 lines
622 B
Go

package admin
import (
"net/http"
"github.com/owncast/owncast/persistence/configrepository"
webutils "github.com/owncast/owncast/webserver/utils"
log "github.com/sirupsen/logrus"
)
// ResetYPRegistration will clear the YP protocol registration key.
func ResetYPRegistration(w http.ResponseWriter, r *http.Request) {
log.Traceln("Resetting YP registration key")
configRepository := configrepository.Get()
if err := configRepository.SetDirectoryRegistrationKey(""); err != nil {
log.Errorln(err)
webutils.WriteSimpleResponse(w, false, err.Error())
return
}
webutils.WriteSimpleResponse(w, true, "reset")
}