| } | } | ||||
| //log in user | //log in user | ||||
| if u.Id == ss.User { | if u.Id == ss.User { | ||||
| ss.RenewIfExpireSoon() | |||||
| *ss = trial //we are the same | |||||
| } else if !ss.IsEmpty() { | |||||
| ss.ReuseAsUser(u.Id, ss.Expire) | |||||
| } else { | } else { | ||||
| ss.InitForUser(ss.User, time.Now().Add(loan.DefaultSessionDuration)) | ss.InitForUser(ss.User, time.Now().Add(loan.DefaultSessionDuration)) | ||||
| } | } |
| ar := apiV1ResponseBlank() | ar := apiV1ResponseBlank() | ||||
| ar.Env.Msg = msg | ar.Env.Msg = msg | ||||
| ar.Env.Session = *ss | ar.Env.Session = *ss | ||||
| ar.Env.Session.Bin = []byte("masked data") //clear | |||||
| ar.Env.Session.Secret = "***********" | ar.Env.Session.Secret = "***********" | ||||
| ar.add("Body", dumpLines) | ar.add("Body", dumpLines) | ||||
| b, _ := ar.toJson() | b, _ := ar.toJson() |