summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r--app/controllers/dashboard/controller.go4
-rw-r--r--app/controllers/dashboard/controller_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/dashboard/controller.go b/app/controllers/dashboard/controller.go
index a1d1bbf..ef5b18d 100644
--- a/app/controllers/dashboard/controller.go
+++ b/app/controllers/dashboard/controller.go
@@ -4,9 +4,9 @@ import (
"net/http"
"github.com/xlgmokha/x/pkg/log"
+ "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/middleware"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/views"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/key"
)
type Controller struct {
@@ -23,7 +23,7 @@ func (c *Controller) MountTo(mux *http.ServeMux) {
}
func (c *Controller) Show(w http.ResponseWriter, r *http.Request) {
- currentUser := key.CurrentUser.From(r.Context())
+ currentUser := cfg.CurrentUser.From(r.Context())
w.WriteHeader(http.StatusOK)
w.Header().Add("Content-Type", "text/html")
diff --git a/app/controllers/dashboard/controller_test.go b/app/controllers/dashboard/controller_test.go
index 20e16ce..ced3fd5 100644
--- a/app/controllers/dashboard/controller_test.go
+++ b/app/controllers/dashboard/controller_test.go
@@ -5,8 +5,8 @@ import (
"testing"
"github.com/stretchr/testify/assert"
+ "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/key"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/test"
)
@@ -30,7 +30,7 @@ func TestController(t *testing.T) {
t.Run("when authenticated", func(t *testing.T) {
t.Run("renders a dashboard page", func(t *testing.T) {
- ctx := key.CurrentUser.With(t.Context(), &domain.User{})
+ ctx := cfg.CurrentUser.With(t.Context(), &domain.User{})
r, w := test.RequestResponse("GET", "/dashboard", test.WithContext(ctx))
mux.ServeHTTP(w, r)