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=