Rework frontend asset structure
This commit is contained in:
parent
11f7749c1d
commit
bc0e92bdac
50 changed files with 93 additions and 70 deletions
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
//go:embed "templates/home.html"
|
||||
var homeHTMLStr string
|
||||
var homeTemplate = static.AssetsAuthHome.MustParseShared(
|
||||
var homeTemplate = static.AssetsHome.MustParseShared(
|
||||
"home.html",
|
||||
homeHTMLStr,
|
||||
)
|
||||
|
|
@ -26,7 +26,7 @@ func (auth *Auth) authHome(ctx context.Context) http.Handler {
|
|||
|
||||
//go:embed "templates/password.html"
|
||||
var passwordHTMLString string
|
||||
var passwordTemplate = static.AssetsAuthLogin.MustParseShared("password.html", passwordHTMLString)
|
||||
var passwordTemplate = static.AssetsUser.MustParseShared("password.html", passwordHTMLString)
|
||||
|
||||
var (
|
||||
errPasswordsNotIdentical = errors.New("passwords are not identical")
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ func (auth *Auth) Logout(w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
//go:embed "templates/login.html"
|
||||
var loginHTMLStr string
|
||||
var loginTemplate = static.AssetsAuthLogin.MustParseShared("login.html", loginHTMLStr)
|
||||
var loginTemplate = static.AssetsUser.MustParseShared("login.html", loginHTMLStr)
|
||||
|
||||
var loginResponse = httpx.Response{
|
||||
ContentType: "text/plain",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
//go:embed "templates/totp_enable.html"
|
||||
var totpEnableStr string
|
||||
var totpEnableTemplate = static.AssetsAuthLogin.MustParseShared("totp_enable.html", totpEnableStr)
|
||||
var totpEnableTemplate = static.AssetsUser.MustParseShared("totp_enable.html", totpEnableStr)
|
||||
|
||||
func (auth *Auth) authTOTPEnable(ctx context.Context) http.Handler {
|
||||
return &httpx.Form[struct{}]{
|
||||
|
|
@ -65,7 +65,7 @@ func (auth *Auth) authTOTPEnable(ctx context.Context) http.Handler {
|
|||
|
||||
//go:embed "templates/totp_enroll.html"
|
||||
var totpEnrollStr string
|
||||
var totpEnrollTemplate = static.AssetsAuthLogin.MustParseShared("totp_enroll.html", totpEnrollStr)
|
||||
var totpEnrollTemplate = static.AssetsUser.MustParseShared("totp_enroll.html", totpEnrollStr)
|
||||
|
||||
type totpEnrollContext struct {
|
||||
userFormContext
|
||||
|
|
@ -142,7 +142,7 @@ func (auth *Auth) authTOTPEnroll(ctx context.Context) http.Handler {
|
|||
|
||||
//go:embed "templates/totp_disable.html"
|
||||
var totpDisableStr string
|
||||
var totpDisableTemplate = static.AssetsAuthLogin.MustParseShared("totp_disable.html", totpDisableStr)
|
||||
var totpDisableTemplate = static.AssetsUser.MustParseShared("totp_disable.html", totpDisableStr)
|
||||
|
||||
func (auth *Auth) authTOTPDisable(ctx context.Context) http.Handler {
|
||||
return &httpx.Form[struct{}]{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue