@@ -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