summaryrefslogtreecommitdiff
path: root/app/controllers/sessions/dto.go
blob: a3ce6bae7531ae25c6b8923f1fdbf5d12c5c44c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package sessions

import (
	"net/http"

	"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/views"
	"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/pls"
)

type RedirectDTO struct {
	URL string
}

func (d *RedirectDTO) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusOK)
	w.Header().Add("Content-Type", "text/html")

	pls.LogError(r.Context(), views.Render(w, "sessions/redirect", d))
}