[이민권] 계정 삭제

- 계정 삭제 취소 기능 추가
This commit is contained in:
2024-01-10 18:40:38 +09:00
parent 0fff694e8a
commit b05473a1c6

View File

@ -687,16 +687,6 @@ func (sh *serviceDescription) authorize(w http.ResponseWriter, r *http.Request)
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
return 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) linkid := link["_id"].(primitive.ObjectID)
newaccid := primitive.NewObjectID() newaccid := primitive.NewObjectID()
for i := 0; i < len(sh.serviceCodeBytes); i++ { for i := 0; i < len(sh.serviceCodeBytes); i++ {
@ -761,6 +751,14 @@ func (sh *serviceDescription) authorize(w http.ResponseWriter, r *http.Request)
if *noauth { if *noauth {
output["noauth"] = true 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) bt, _ := json.Marshal(output)
w.Write(bt) w.Write(bt)
} else if len(session) > 0 { } else if len(session) > 0 {