Skip to content

Commit

Permalink
Test fix for login successfull page on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet committed May 6, 2024
1 parent 2ca765d commit fc48f31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/pkg/auth/user_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"net/http"
"os"
"os/exec"
"path/filepath"
"path"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -170,7 +170,9 @@ func AuthorizeUser(p *print.Printer, isReauthentication bool) error {
Email: email,
}

htmlTemplate, err := template.ParseFS(htmlContent, filepath.Join(htmlTemplatesPath, loginSuccessfulHTMLFile))
// ParseFS expects paths using forward slashes, even on Windows
// See: https://github.com/golang/go/issues/44305#issuecomment-780111748
htmlTemplate, err := template.ParseFS(htmlContent, path.Join(htmlTemplatesPath, loginSuccessfulHTMLFile))
if err != nil {
errServer = fmt.Errorf("parse html file: %w", err)
}
Expand Down

0 comments on commit fc48f31

Please sign in to comment.