diff options
author | FChannel <=> | 2021-01-28 15:55:32 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-28 15:55:32 -0800 |
commit | 04d5d59acbf340382ecb63c0f98dd55e32e11035 (patch) | |
tree | 6acd2d596fdad926360065135583ba74f44313ce /OutboxPost.go | |
parent | 488b260a1b5019e3a1aa37b55272bc1333be31b5 (diff) |
remote auth for follow request
Diffstat (limited to 'OutboxPost.go')
-rw-r--r-- | OutboxPost.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OutboxPost.go b/OutboxPost.go index 979173f..fc4a84a 100644 --- a/OutboxPost.go +++ b/OutboxPost.go @@ -531,15 +531,16 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { case "Follow": for _, e := range activity.To { - - if GetActorFromDB(db, e).Id != "" { - response := AcceptFollow(activity) - response = SetActorFollowerDB(db, response) - MakeActivityRequest(db, response) - } else { - fmt.Println("follow request for rejected") - response := RejectFollow(activity) - MakeActivityRequest(db, response) + if len(auth) > 1 && RemoteActorHasAuth(activity.Actor.Id, auth[1]) { + if GetActorFromDB(db, e).Id != "" { + response := AcceptFollow(activity) + response = SetActorFollowerDB(db, response) + MakeActivityRequest(db, response) + } else { + fmt.Println("follow request for rejected") + response := RejectFollow(activity) + MakeActivityRequest(db, response) + } } } break |