diff --git a/.github/workflows/update-dev-manifets.yaml b/.github/workflows/update-dev-manifets.yaml index 2dc7498..46a1f4f 100644 --- a/.github/workflows/update-dev-manifets.yaml +++ b/.github/workflows/update-dev-manifets.yaml @@ -1,10 +1,10 @@ name: deploy-dev-manifests on: - push: - branches: - - 'main' - workflow_dispatch: + workflow_run: + workflows: ["build-api", "build-container-builder", "build-null-operator"] + types: + - completed jobs: build-manifests: diff --git a/api/middleware/dumbauthz.go b/api/middleware/dumbauthz.go index 3acf4b5..8f6770b 100644 --- a/api/middleware/dumbauthz.go +++ b/api/middleware/dumbauthz.go @@ -24,8 +24,8 @@ func (k *AuthzMiddleware) CheckAuthz(next http.Handler) http.Handler { // Check if the user-id header is set userId, ok := r.Context().Value("user-id").(string) if !ok { - fmt.Println("User is new, redirecting to new user page") - http.Error(w, "User is new, redirecting to new user page", http.StatusTemporaryRedirect) + fmt.Println("User is new") + http.Error(w, "User is new, they need to ", http.StatusBadRequest) w.Header().Set("location", "/newuser") return } @@ -34,8 +34,7 @@ func (k *AuthzMiddleware) CheckAuthz(next http.Handler) http.Handler { _, err := user.GetUserForId(userId, k.db) if err != nil { - fmt.Println("User is new, redirecting to new user page") - http.Error(w, "User is new, redirecting to new user page", http.StatusTemporaryRedirect) + http.Error(w, "User is new, please register user", http.StatusBadRequest) w.Header().Set("location", "/newuser") return } diff --git a/api/middleware/newuser.go b/api/middleware/newuser.go index d9b562c..7436c8b 100644 --- a/api/middleware/newuser.go +++ b/api/middleware/newuser.go @@ -26,8 +26,7 @@ func (k *UserMiddleware) NewUserMiddlewareCheck(next http.Handler) http.Handler _, err := user.GetUserForId(userId, k.db) if err != nil { - fmt.Println("User is new, redirecting to new user page") - http.Error(w, "User is new, redirecting to new user page", http.StatusTemporaryRedirect) + http.Error(w, "User is new, please register user", http.StatusBadRequest) w.Header().Set("location", "/newuser") return }