added notify helpers
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user