diff --git a/apiV1login.go b/apiV1login.go index a6d0e2c..4487c05 100644 --- a/apiV1login.go +++ b/apiV1login.go @@ -47,7 +47,9 @@ func apiV1Login(w http.ResponseWriter, r *http.Request, ss *loan.Session) { } //log in 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 { ss.InitForUser(ss.User, time.Now().Add(loan.DefaultSessionDuration)) } diff --git a/main.go b/main.go index 5af2b2a..7fa5320 100644 --- a/main.go +++ b/main.go @@ -76,6 +76,7 @@ func apiV1DumpRequest(w http.ResponseWriter, r *http.Request, ss *loan.Session) ar := apiV1ResponseBlank() ar.Env.Msg = msg ar.Env.Session = *ss + ar.Env.Session.Bin = []byte("masked data") //clear ar.Env.Session.Secret = "***********" ar.add("Body", dumpLines) b, _ := ar.toJson()