From b05473a1c68a9eb98055262d2be2d10812892a95 Mon Sep 17 00:00:00 2001 From: mklee Date: Wed, 10 Jan 2024 18:40:38 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EB=AF=BC=EA=B6=8C]=20=EA=B3=84?= =?UTF-8?q?=EC=A0=95=20=EC=82=AD=EC=A0=9C=20-=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EC=B7=A8=EC=86=8C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/service.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/core/service.go b/core/service.go index 1d5699c..b125ac4 100644 --- a/core/service.go +++ b/core/service.go @@ -687,16 +687,6 @@ func (sh *serviceDescription) authorize(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusInternalServerError) return } - if link["_ts"] != nil { - delts := link["_ts"].(primitive.DateTime) - if !delts.Time().IsZero() { - // 삭제된 계정. 삭제 되었다고 알려주자 - w.Header().Add("MG-ACCOUNT-DELETED", "TRUE") - w.WriteHeader(http.StatusUnauthorized) - return - } - } - linkid := link["_id"].(primitive.ObjectID) newaccid := primitive.NewObjectID() for i := 0; i < len(sh.serviceCodeBytes); i++ { @@ -761,6 +751,14 @@ func (sh *serviceDescription) authorize(w http.ResponseWriter, r *http.Request) if *noauth { output["noauth"] = true } + + if link["_ts"] != nil { + delts := link["_ts"].(primitive.DateTime) + if !delts.Time().IsZero() { + // 삭제된 계정. 삭제 되었다고 알려주자 + w.Header().Add("MG-ACCOUNT-DELETED", "TRUE") + } + } bt, _ := json.Marshal(output) w.Write(bt) } else if len(session) > 0 {