make sure tempcode exists in user record

This commit is contained in:
stremovsky
2019-12-24 11:49:11 +02:00
parent c7493f22d8
commit ebd91fda83

View File

@@ -288,8 +288,10 @@ func (e mainEnv) userLoginEnter(w http.ResponseWriter, r *http.Request, ps httpr
userTOKEN := userBson["token"].(string)
event.Record = userTOKEN
fmt.Printf("Found user record: %s\n", userBson)
tmpCode := userBson["tempcode"].(int32)
tmpCode := int32(0)
if _, ok := userBson["tempcode"]; ok {
tmpCode = userBson["tempcode"].(int32)
}
if tmp == tmpCode {
// user ented correct key
// generate temp user access code