Fix: on login add player once

This commit is contained in:
Grail Finder
2025-07-11 09:03:18 +03:00
parent d056c4a07e
commit 37fe76456e
7 changed files with 30 additions and 34 deletions

View File

@ -61,8 +61,6 @@ func GetSession(next http.Handler) http.Handler {
return
}
userSession, err := repo.SessionByToken(r.Context(), sessionToken)
// userSession, err := cacheGetSession(sessionToken)
// log.Debug("userSession from cache", "us", userSession)
if err != nil {
msg := "auth failed; session does not exists"
log.Debug(msg, "error", err, "key", sessionToken)
@ -83,13 +81,6 @@ func GetSession(next http.Handler) http.Handler {
models.CtxUsernameKey, userSession.Username)
ctx = context.WithValue(ctx,
models.CtxSessionKey, userSession)
// if err := cacheSetSession(sessionToken,
// userSession); err != nil {
// msg := "failed to marshal user session"
// log.Warn(msg, "error", err)
// next.ServeHTTP(w, r)
// return
// }
next.ServeHTTP(w, r.WithContext(ctx))
})
}