From 087743453c6fab97e886a2a1e1c89db527985993 Mon Sep 17 00:00:00 2001 From: mountain Date: Mon, 4 Sep 2023 14:37:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/service.go | 10 +++++----- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/service.go b/core/service.go index 4a06be6..b7d0572 100644 --- a/core/service.go +++ b/core/service.go @@ -311,7 +311,7 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) { //if oldAuth.Token != oldToken || oldAuth.Uid != oldId || oldAuth.Platform != oldType { if oldAuth.Uid != oldId || oldAuth.Platform != oldType { - logger.Println("link failed. session key is not correct :", *oldAuth, queryvals) + logger.Println("link failed. session key is not correct :", oldAuth, queryvals) w.WriteHeader(http.StatusBadRequest) return } @@ -425,7 +425,7 @@ func (sh *serviceDescription) unlink(w http.ResponseWriter, r *http.Request) { // fmt.Println("=================") if authInfo.Uid != sId || authInfo.Platform != sType { - logger.Println("unlink failed. session key is not correct :", *authInfo, queryvals) + logger.Println("unlink failed. session key is not correct :", authInfo, queryvals) w.WriteHeader(http.StatusBadRequest) return } @@ -517,7 +517,7 @@ func (sh *serviceDescription) linkinfo(w http.ResponseWriter, r *http.Request) { //if oldAuth.Token != oldToken || oldAuth.Uid != oldId || oldAuth.Platform != oldType { if authInfo.Uid != sId || authInfo.Platform != sType { - logger.Println("linkinfo failed. session key is not correct :", *authInfo, queryvals) + logger.Println("linkinfo failed. session key is not correct :", authInfo, queryvals) w.WriteHeader(http.StatusBadRequest) return } @@ -739,7 +739,7 @@ func (sh *serviceDescription) serveHTTP(w http.ResponseWriter, r *http.Request) return } - if authInfo == nil { + if authInfo.Account.IsZero() { logger.Println("sessionkey is not valid :", sk) w.WriteHeader(http.StatusUnauthorized) return @@ -767,7 +767,7 @@ func (sh *serviceDescription) serveHTTP(w http.ResponseWriter, r *http.Request) return } - if authInfo == nil { + if authInfo.Account.IsZero() { logger.Println("sessionkey is not valid :", sk) w.WriteHeader(http.StatusUnauthorized) return diff --git a/go.mod b/go.mod index e2d0e89..9e4dbd2 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/golang-jwt/jwt v3.2.2+incompatible go.mongodb.org/mongo-driver v1.11.7 google.golang.org/api v0.128.0 - repositories.action2quare.com/ayo/gocommon v0.0.0-20230904025656-0eefb438a6d3 + repositories.action2quare.com/ayo/gocommon v0.0.0-20230904053533-821dc5c639d8 ) require ( diff --git a/go.sum b/go.sum index 4bb7c23..e5307af 100644 --- a/go.sum +++ b/go.sum @@ -359,3 +359,5 @@ repositories.action2quare.com/ayo/gocommon v0.0.0-20230904005440-d396a35713ad h1 repositories.action2quare.com/ayo/gocommon v0.0.0-20230904005440-d396a35713ad/go.mod h1:PdpZ16O1czKKxCxn+0AFNaEX/0kssYwC3G8jR0V7ybw= repositories.action2quare.com/ayo/gocommon v0.0.0-20230904025656-0eefb438a6d3 h1:6IBLAxab5ntTG+TGjvd7+Pm+QHipQMS7GKg+XrXjn88= repositories.action2quare.com/ayo/gocommon v0.0.0-20230904025656-0eefb438a6d3/go.mod h1:PdpZ16O1czKKxCxn+0AFNaEX/0kssYwC3G8jR0V7ybw= +repositories.action2quare.com/ayo/gocommon v0.0.0-20230904053533-821dc5c639d8 h1:clQB7s726Rt/q2BgGjZMVjek7Z0YDBUrD4HjFKUFSIw= +repositories.action2quare.com/ayo/gocommon v0.0.0-20230904053533-821dc5c639d8/go.mod h1:PdpZ16O1czKKxCxn+0AFNaEX/0kssYwC3G8jR0V7ybw=