Browse Source

Authy

hkremer/rebranding
Gregory Rudolph 4 years ago
parent
commit
3bba74c076
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 6
      auth.go

6
auth.go

@ -75,8 +75,8 @@ func tryLogin(w http.ResponseWriter, r *http.Request) { @@ -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) { @@ -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,

Loading…
Cancel
Save