|
|
@ -381,7 +381,7 @@ func Layout(view ViewContext, content templ.Component) templ.Component { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func LoginForm(title string, errorMessage string, csrfToken string) templ.Component { |
|
|
|
|
|
|
|
|
func LoginForm(title string, errorMessage string, csrfToken string, localAuthEnabled bool, oidcAuthEnabled bool) templ.Component { |
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { |
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { |
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context |
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context |
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { |
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { |
|
|
@ -451,20 +451,44 @@ func LoginForm(title string, errorMessage string, csrfToken string) templ.Compon |
|
|
return templ_7745c5c3_Err |
|
|
return templ_7745c5c3_Err |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<form method=\"POST\" action=\"/login\"><input type=\"hidden\" name=\"csrf_token\" value=\"") |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
|
|
|
if localAuthEnabled { |
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<form method=\"POST\" action=\"/login\"><input type=\"hidden\" name=\"csrf_token\" value=\"") |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
} |
|
|
|
|
|
var templ_7745c5c3_Var20 string |
|
|
|
|
|
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(csrfToken) |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 394, Col: 88} |
|
|
|
|
|
} |
|
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
} |
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\"><div class=\"mb-3\"><label for=\"username\" class=\"form-label\">Username</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"fas fa-user\"></i></span> <input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required></div></div><div class=\"mb-4\"><label for=\"password\" class=\"form-label\">Password</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"fas fa-lock\"></i></span> <input type=\"password\" class=\"form-control\" id=\"password\" name=\"password\" required></div></div><button type=\"submit\" class=\"btn btn-primary w-100\"><i class=\"fas fa-sign-in-alt me-2\"></i>Sign In</button></form>") |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
var templ_7745c5c3_Var20 string |
|
|
|
|
|
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(csrfToken) |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 393, Col: 84} |
|
|
|
|
|
|
|
|
if localAuthEnabled && oidcAuthEnabled { |
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<div class=\"text-center text-muted my-3\">or</div>") |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
|
|
|
if oidcAuthEnabled { |
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<a href=\"/login/oidc\" class=\"btn btn-outline-primary w-100\"><i class=\"fas fa-id-badge me-2\"></i>Sign in with OIDC</a> ") |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if !localAuthEnabled && !oidcAuthEnabled { |
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<div class=\"alert alert-warning mb-0\" role=\"alert\">No sign-in method is configured.</div>") |
|
|
|
|
|
if templ_7745c5c3_Err != nil { |
|
|
|
|
|
return templ_7745c5c3_Err |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\"><div class=\"mb-3\"><label for=\"username\" class=\"form-label\">Username</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"fas fa-user\"></i></span> <input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required></div></div><div class=\"mb-4\"><label for=\"password\" class=\"form-label\">Password</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"fas fa-lock\"></i></span> <input type=\"password\" class=\"form-control\" id=\"password\" name=\"password\" required></div></div><button type=\"submit\" class=\"btn btn-primary w-100\"><i class=\"fas fa-sign-in-alt me-2\"></i>Sign In</button></form></div></div></div></div></div><script src=\"/static/js/bootstrap.bundle.min.js\"></script></body></html>") |
|
|
|
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</div></div></div></div></div><script src=\"/static/js/bootstrap.bundle.min.js\"></script></body></html>") |
|
|
if templ_7745c5c3_Err != nil { |
|
|
if templ_7745c5c3_Err != nil { |
|
|
return templ_7745c5c3_Err |
|
|
return templ_7745c5c3_Err |
|
|
} |
|
|
} |
|
|
|