Fix preview custom auth screen templates
This commit is contained in:
parent
f9823a6c5d
commit
f2cdc1a586
@ -21,7 +21,7 @@
|
||||
<style>
|
||||
body {
|
||||
font-size: 1rem !important;
|
||||
{{ safeCSS .authBg }}
|
||||
{{ .authBg }}
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
@ -143,7 +143,6 @@ func New(ctx context.Context, log *zap.Logger, oa2m oauth2def.Manager, s store.S
|
||||
// temp, will be replaced
|
||||
"language": func() string { return language.Tag{}.String() },
|
||||
"tr": func(key string, pp ...string) string { return key },
|
||||
"safeCSS": func(styles string) template.CSS { return template.CSS(styles) },
|
||||
})
|
||||
|
||||
useEmbedded = len(opt.AssetsPath) == 0
|
||||
|
||||
@ -6,6 +6,7 @@ package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
@ -42,8 +43,13 @@ func (h *AuthHandlers) devSceneView(w http.ResponseWriter, r *http.Request) {
|
||||
r.URL.Query().Get("scene"),
|
||||
)
|
||||
|
||||
s.Data["authBg"] = template.CSS(h.bgStylesData())
|
||||
|
||||
if err == nil && s != nil {
|
||||
err = h.Templates.ExecuteTemplate(w, s.Template+".html.tpl", s.Data)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/gob"
|
||||
"fmt"
|
||||
"github.com/cortezaproject/corteza/server/pkg/errors"
|
||||
"html/template"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
@ -20,6 +19,7 @@ import (
|
||||
"github.com/cortezaproject/corteza/server/auth/saml"
|
||||
"github.com/cortezaproject/corteza/server/auth/settings"
|
||||
"github.com/cortezaproject/corteza/server/pkg/auth"
|
||||
"github.com/cortezaproject/corteza/server/pkg/errors"
|
||||
"github.com/cortezaproject/corteza/server/pkg/locale"
|
||||
"github.com/cortezaproject/corteza/server/pkg/options"
|
||||
"github.com/cortezaproject/corteza/server/system/types"
|
||||
@ -411,7 +411,7 @@ func (h *AuthHandlers) enrichTmplData(req *request.AuthReq) interface{} {
|
||||
dSettings.Providers = nil
|
||||
d["settings"] = dSettings
|
||||
|
||||
d["authBg"] = h.bgStylesData()
|
||||
d["authBg"] = template.CSS(h.bgStylesData())
|
||||
|
||||
return d
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user