Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/pkg/auth/templates/login-successful.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
<div class="logo m-5">
<img
alt="logo"
src="https://cdn.apps.01.cf.eu01.stackit.cloud/assets/img/logo_inverted.svg"
src="/stackit_nav_logo_light.svg"
/>
</div>

Expand Down
11 changes: 11 additions & 0 deletions internal/pkg/auth/templates/stackit_nav_logo_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion internal/pkg/auth/user_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
stackitLandingPage = "https://www.stackit.de"
htmlTemplatesPath = "templates"
loginSuccessfulHTMLFile = "login-successful.html"
logoPath = "/stackit_nav_logo_light.svg"
logoSVGFilePath = "stackit_nav_logo_light.svg"

// The IDP doesn't support wildcards for the port,
// so we configure a range of ports from 8000 to 8020
Expand Down Expand Up @@ -207,8 +209,7 @@
http.Redirect(w, r, loginSuccessURL, http.StatusSeeOther)
})

mux.HandleFunc(loginSuccessPath, func(w http.ResponseWriter, _ *http.Request) {

Check failure on line 212 in internal/pkg/auth/user_login.go

View workflow job for this annotation

GitHub Actions / CI

empty-lines: extra empty line at the start of a block (revive)
defer cleanup(server)

email, err := GetAuthField(USER_EMAIL)
if err != nil {
Expand All @@ -232,6 +233,20 @@
}
})

mux.HandleFunc(logoPath, func(w http.ResponseWriter, _ *http.Request) {
defer cleanup(server)

img, err := htmlContent.ReadFile(path.Join(htmlTemplatesPath, logoSVGFilePath))
if err != nil {
errServer = fmt.Errorf("read logo file: %w", err)
}
w.Header().Set("Content-Type", "image/svg+xml")
_, err = w.Write(img)
if err != nil {
return
}
})

p.Debug(print.DebugLevel, "opening browser for authentication: %s", authorizationURL)
p.Debug(print.DebugLevel, "using authentication server on %s", idpWellKnownConfig.Issuer)
p.Debug(print.DebugLevel, "using client ID %s for authentication ", idpClientID)
Expand Down
Loading