Skip to content

Commit 182850e

Browse files
committed
add new STACKIT logo
1 parent 881d2fb commit 182850e

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

internal/pkg/auth/templates/login-successful.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
<div class="logo m-5">
272272
<img
273273
alt="logo"
274-
src="https://cdn.apps.01.cf.eu01.stackit.cloud/assets/img/logo_inverted.svg"
274+
src="/stackit_nav_logo_light.svg"
275275
/>
276276
</div>
277277

Lines changed: 11 additions & 0 deletions
Loading

internal/pkg/auth/user_login.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const (
3030
stackitLandingPage = "https://www.stackit.de"
3131
htmlTemplatesPath = "templates"
3232
loginSuccessfulHTMLFile = "login-successful.html"
33+
logoPath = "/stackit_nav_logo_light.svg"
34+
logoSVGFilePath = "stackit_nav_logo_light.svg"
3335

3436
// The IDP doesn't support wildcards for the port,
3537
// so we configure a range of ports from 8000 to 8020
@@ -208,7 +210,6 @@ func AuthorizeUser(p *print.Printer, isReauthentication bool) error {
208210
})
209211

210212
mux.HandleFunc(loginSuccessPath, func(w http.ResponseWriter, _ *http.Request) {
211-
defer cleanup(server)
212213

213214
email, err := GetAuthField(USER_EMAIL)
214215
if err != nil {
@@ -232,6 +233,20 @@ func AuthorizeUser(p *print.Printer, isReauthentication bool) error {
232233
}
233234
})
234235

236+
mux.HandleFunc(logoPath, func(w http.ResponseWriter, _ *http.Request) {
237+
defer cleanup(server)
238+
239+
img, err := htmlContent.ReadFile(path.Join(htmlTemplatesPath, logoSVGFilePath))
240+
if err != nil {
241+
errServer = fmt.Errorf("read logo file: %w", err)
242+
}
243+
w.Header().Set("Content-Type", "image/svg+xml")
244+
_, err = w.Write(img)
245+
if err != nil {
246+
return
247+
}
248+
})
249+
235250
p.Debug(print.DebugLevel, "opening browser for authentication: %s", authorizationURL)
236251
p.Debug(print.DebugLevel, "using authentication server on %s", idpWellKnownConfig.Issuer)
237252
p.Debug(print.DebugLevel, "using client ID %s for authentication ", idpClientID)

0 commit comments

Comments
 (0)