Compare commits
2 Commits
9ccd97564a
...
7470f8e001
| Author | SHA1 | Date | |
|---|---|---|---|
| 7470f8e001 | |||
| fc70a9482c |
@ -372,6 +372,7 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
logger.Error("getProviderInfo failed :", err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
createtime := primitive.NewDateTimeFromTime(time.Now().UTC())
|
||||
@ -457,6 +458,7 @@ func (sh *serviceDescription) unlink(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Println("accid", authInfo.Accid.String())
|
||||
accDocs, err := sh.mongoClient.FindAll(CollectionAccount, bson.M{
|
||||
"accid": authInfo.Accid,
|
||||
}, options.Find().SetProjection(bson.M{
|
||||
@ -474,6 +476,8 @@ func (sh *serviceDescription) unlink(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Println("len(accDocs)", len(accDocs), accDocs)
|
||||
|
||||
var ids primitive.A
|
||||
for _, accDoc := range accDocs {
|
||||
ids = append(ids, accDoc["_id"].(primitive.ObjectID))
|
||||
@ -628,6 +632,7 @@ func (sh *serviceDescription) authorize(w http.ResponseWriter, r *http.Request)
|
||||
if err != nil {
|
||||
logger.Error("getProviderInfo failed :", err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
if authtype != newType || uid != newId {
|
||||
|
||||
Reference in New Issue
Block a user