Skip to content

Commit

Permalink
Update ui.go
Browse files Browse the repository at this point in the history
probable fix
  • Loading branch information
anantshri committed May 12, 2024
1 parent 12d1bf7 commit 09389e2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/authn/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"path"
"strings"
"text/template"
"net/url"
)

// Themes stores UI themes.
Expand Down Expand Up @@ -276,9 +277,20 @@ func (f *Factory) DeleteTemplates() {
return
}

func customPathJoin(args ...string) string {
// Example of additional logic: cleaning each path part before joining
encodedArgs := make([]string, len(args))
for i, arg := range args {
encodedArgs[i] = url.QueryEscape(arg)
}
// Join the cleaned path elements
joinedPath := path.Join(encodedArgs...)
return joinedPath
}

func loadTemplateFromString(s, p string) (*template.Template, error) {
funcMap := template.FuncMap{
"pathjoin": path.Join,
"pathjoin": customPathJoin,
"brsplitline": func(s string) string {
var output []rune
var count = 0
Expand Down

0 comments on commit 09389e2

Please sign in to comment.