From f23dba9454aded164d5039681e69926f7f8e90a2 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 30 Dec 2020 11:40:28 -0500 Subject: [PATCH] Authy --- auth.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auth.go b/auth.go index b623df9..eabcf2f 100644 --- a/auth.go +++ b/auth.go @@ -17,9 +17,10 @@ func reqPass(w http.ResponseWriter, r *http.Request) { log.LogInfo("reqPass username is %+v.", username) var userID string g, err := dg.Guild(config.GuildID) + log.LogInfo("reqPass guild is %+v.", config.GuildID) if err == nil { for _, m := range g.Members { - if m.User.Username == username { + if strings.ToUpper(m.User.Username) == strings.ToUpper(username) { userID = m.User.ID log.LogInfo("User ID found for %+v as %+v", username, userID) } @@ -28,6 +29,7 @@ func reqPass(w http.ResponseWriter, r *http.Request) { log.LogError("Unable to find user ID for %+v", username) } ipaddr := r.Header.Get("X-Real-IP") + log.LogInfo("reqPass IP is %+v.", ipaddr) log.LogInfo(fmt.Sprintf("reqPass called:```username: %s\nip : %s```", username, ipaddr)) go sendPassword(userID, ipaddr) http.Redirect(w, r, "/login", 302) @@ -101,6 +103,7 @@ func genPassword(length int) string { } func sendPassword(user string, ipaddr string) { defer log.PanicSafe() + log.LogInfo("sending password to %+v for %+v", ipaddr, user) str := genPassword(8) m, _ := dg.GuildMember(config.GuildID, user) toks[m.User.Username] = tokens{