finished login/registration

This commit is contained in:
2026-01-24 13:13:22 +11:00
parent ff0f61f534
commit c780050f8e
13 changed files with 164 additions and 92 deletions

View File

@@ -3,6 +3,7 @@ package handlers
import (
"net/http"
"git.haelnorr.com/h/golib/cookies"
"git.haelnorr.com/h/golib/hws"
"github.com/pkg/errors"
@@ -15,6 +16,7 @@ import (
func Login(server *hws.Server, cfg *config.Config, st *store.Store, discordAPI *discord.APIClient) http.Handler {
return http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
cookies.SetPageFrom(w, r, cfg.HWSAuth.TrustedHost)
// Track login redirect attempts
attempts, exceeded, track := st.TrackRedirect(r, "/login", 5)