Fix session retrieval issue after migrating to Redis cache

This commit is contained in:
2024-09-08 16:41:33 +07:00
parent 2c5de2b336
commit 29ab28fd93
5 changed files with 30 additions and 42 deletions

View File

@ -10,7 +10,7 @@ func DELETE(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
_, mySession, _ := session.GetSession(r)
otherSession, _ := session.Get(id)
otherSession := session.Get(id)
if _, err := session.GetSessionInfo(mySession.Email, otherSession.ID); err != nil {
w.WriteHeader(http.StatusUnauthorized)
return