fix(auth): close div tag in logout template

This commit is contained in:
Claus Lohmar 2026-06-15 09:17:52 +00:00
parent b3d015a26a
commit 9f7e4c8a68
2 changed files with 30 additions and 16 deletions

View file

@ -26,14 +26,18 @@ templ LogoutPage(authLogoutURL, workspaceURL string) {
<h1>Logged Out</h1> <h1>Logged Out</h1>
<div class="status">✓ Session cleared</div> <div class="status">✓ Session cleared</div>
<p>You have been logged out of Next Workspace. Your identity provider session will also be cleared.</p> <p>You have been logged out of Next Workspace. Your identity provider session will also be cleared.</p>
<a href={ workspaceURL } class="btn btn-primary">Re-login</a> <a href={ workspaceURL } class="btn btn-primary">Re-login</a>
if authLogoutURL != "" {
<a href={ authLogoutURL } class="btn btn-secondary">Sign out from Authelia</a> <a href={ authLogoutURL } class="btn btn-secondary">Sign out from Authelia</a>
}
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
// Redirect to Authelia logout after a short delay // Only auto-redirect on first visit (before Authelia logout returns)
setTimeout(function() { if (document.querySelector('.btn-secondary')) {
window.location.href = document.querySelector('.btn-secondary').href; setTimeout(function() {
}, 1500); window.location.href = document.querySelector('.btn-secondary').href;
}, 1500);
}
</script> </script>
</body> </body>
</html> </html>

View file

@ -36,26 +36,36 @@ func LogoutPage(authLogoutURL, workspaceURL string) templ.Component {
var templ_7745c5c3_Var2 templ.SafeURL var templ_7745c5c3_Var2 templ.SafeURL
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinURLErrs(workspaceURL) templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinURLErrs(workspaceURL)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/ui/logout.templ`, Line: 29, Col: 26} return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/ui/logout.templ`, Line: 29, Col: 25}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" class=\"btn btn-primary\">Re-login</a> <a href=\"") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" class=\"btn btn-primary\">Re-login</a> ")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var3 templ.SafeURL if authLogoutURL != "" {
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinURLErrs(authLogoutURL) templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<a href=\"")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/ui/logout.templ`, Line: 30, Col: 27} return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 templ.SafeURL
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinURLErrs(authLogoutURL)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/ui/logout.templ`, Line: 31, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" class=\"btn btn-secondary\">Sign out from Authelia</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</div><script type=\"text/javascript\">\n\t\t\t\t// Only auto-redirect on first visit (before Authelia logout returns)\n\t\t\t\tif (document.querySelector('.btn-secondary')) {\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\twindow.location.href = document.querySelector('.btn-secondary').href;\n\t\t\t\t\t}, 1500);\n\t\t\t\t}\n\t\t\t</script></body></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" class=\"btn btn-secondary\">Sign out from Authelia</a></div><script type=\"text/javascript\">\n\t\t\t\t// Redirect to Authelia logout after a short delay\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\twindow.location.href = document.querySelector('.btn-secondary').href;\n\t\t\t\t}, 1500);\n\t\t\t</script></body></html>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }