Feat: roomlist & join room

This commit is contained in:
Grail Finder
2025-05-09 14:39:33 +03:00
parent 45761446e5
commit 6c9c86f02b
10 changed files with 141 additions and 10 deletions

View File

@ -17,7 +17,7 @@ import (
)
func abortWithError(w http.ResponseWriter, msg string) {
w.WriteHeader(500)
w.WriteHeader(200) // must be 200 for htmx to replace components
tmpl := template.Must(template.ParseGlob("components/*.html"))
tmpl.ExecuteTemplate(w, "error", msg)
}
@ -109,9 +109,9 @@ func makeCookie(username string, remote string) (*http.Cookie, error) {
cookieValue := base64.URLEncoding.EncodeToString([]byte(
string(signature) + sessionToken))
cookie := &http.Cookie{
Name: cookieName,
Value: cookieValue,
// Secure: true,
Name: cookieName,
Value: cookieValue,
Secure: true,
HttpOnly: true,
SameSite: http.SameSiteNoneMode,
Domain: cfg.ServerConfig.Host,