added notify helpers

This commit is contained in:
2026-01-26 13:45:17 +11:00
parent a5b92a247b
commit e47619abd4
6 changed files with 83 additions and 33 deletions

View File

@@ -16,6 +16,13 @@ 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) {
// TODO: check DB is connected
// check discord API is working
if r.Method == "POST" {
// if either fail, notify the client that login is unavailable right now
// otherwise proceed redirect to GET method
}
// if either fail and method is GET, show service not available page
cookies.SetPageFrom(w, r, cfg.HWSAuth.TrustedHost)
attempts, exceeded, track := st.TrackRedirect(r, "/login", 5)