This commit is contained in:
2020-12-30 12:12:06 -05:00
parent 8460b10e9f
commit 3bba74c076

View File

@ -75,8 +75,8 @@ func tryLogin(w http.ResponseWriter, r *http.Request) {
func usePassword(user string, pass string, ip string) bool {
defer log.PanicSafe()
log.LogInfo("%+v", toks)
tok := toks[user]
delete(toks, user)
tok := toks[strings.ToUpper(user)]
delete(toks, strings.ToUpper(user))
if tok.IP != ip {
log.LogWarn(fmt.Sprintf("%s attempted to use an improper IP.", user))
return false
@ -114,7 +114,7 @@ func sendPassword(user string, ipaddr string) {
log.LogErrorType(err)
}
now := time.Now()
toks[m.Nick] = Tokens{
toks[strings.ToUpper(m.Nick)] = Tokens{
Username: user,
IP: ipaddr,
Password: str,