mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-30 01:17:21 +02:00
fix profile image on dashboard (#1637)
This commit is contained in:
parent
0d7980faef
commit
b121e436f3
3 changed files with 14 additions and 5 deletions
|
@ -12,8 +12,8 @@
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h2>Current user</h2>
|
<h2>Current user</h2>
|
||||||
{{with .User.GetClaim "picture"}}
|
{{range .User.GetClaim "picture"}}
|
||||||
<img class="icon" src="{{.}}" alt="user image" />
|
<img class="icon" src="{{.|safeURL}}" alt="user image" />
|
||||||
{{else}}
|
{{else}}
|
||||||
<img
|
<img
|
||||||
class="icon"
|
class="icon"
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{with .User.GetClaim "given_name"}}
|
{{range .User.GetClaim "given_name"}}
|
||||||
<label>
|
<label>
|
||||||
<span>Given Name</span>
|
<span>Given Name</span>
|
||||||
<input
|
<input
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{with .User.GetClaim "family_name"}}
|
{{range .User.GetClaim "family_name"}}
|
||||||
<label>
|
<label>
|
||||||
<span>Family Name</span>
|
<span>Family Name</span>
|
||||||
<input
|
<input
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -60,6 +60,15 @@ func NewTemplates() (*template.Template, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
t := template.New("pomerium-templates").Funcs(map[string]interface{}{
|
t := template.New("pomerium-templates").Funcs(map[string]interface{}{
|
||||||
|
"safeURL": func(arg interface{}) template.URL {
|
||||||
|
return template.URL(fmt.Sprint(arg))
|
||||||
|
},
|
||||||
|
"safeHTML": func(arg interface{}) template.HTML {
|
||||||
|
return template.HTML(fmt.Sprint(arg))
|
||||||
|
},
|
||||||
|
"safeHTMLAttr": func(arg interface{}) template.HTMLAttr {
|
||||||
|
return template.HTMLAttr(fmt.Sprint(arg))
|
||||||
|
},
|
||||||
"dataURL": func(p string) template.URL {
|
"dataURL": func(p string) template.URL {
|
||||||
return dataURLs[strings.TrimPrefix(p, "/.pomerium/assets")]
|
return dataURLs[strings.TrimPrefix(p, "/.pomerium/assets")]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue