Merge remote-tracking branch 'origin/develop' into webv2

This commit is contained in:
Gabe Kangas
2022-06-19 13:52:22 -07:00
60 changed files with 1533 additions and 1154 deletions

View File

@@ -6,13 +6,16 @@ import (
ia "github.com/owncast/owncast/auth/indieauth"
"github.com/owncast/owncast/controllers"
"github.com/owncast/owncast/router/middleware"
)
// HandleAuthEndpoint will handle the IndieAuth auth endpoint.
func HandleAuthEndpoint(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodGet {
// Require the GET request for IndieAuth to be behind admin login.
handleAuthEndpointGet(w, r)
f := middleware.RequireAdminAuth(handleAuthEndpointGet)
f(w, r)
return
} else if r.Method == http.MethodPost {
handleAuthEndpointPost(w, r)
} else {