aboutsummaryrefslogtreecommitdiff
path: root/OutboxPost.go
diff options
context:
space:
mode:
authorFChannel <=>2021-02-01 23:39:32 -0800
committerFChannel <=>2021-02-01 23:39:32 -0800
commit7df3590fe3cabd7372a739f7f70057c5d9185c23 (patch)
tree902b1df1ca15e9393ef7901fcff6d12416ea0009 /OutboxPost.go
parent3bedb51f6a878253cfdf10ab89c67312fcd93886 (diff)
changed to base 36 for post ids
Diffstat (limited to 'OutboxPost.go')
-rw-r--r--OutboxPost.go25
1 files changed, 21 insertions, 4 deletions
diff --git a/OutboxPost.go b/OutboxPost.go
index f509b04..a51d509 100644
--- a/OutboxPost.go
+++ b/OutboxPost.go
@@ -97,7 +97,7 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) {
var verify Verify
verify.Identifier = "admin"
- verify.Board = Domain
+ verify.Board = activity.Actor.Id
verify = GetVerificationCode(db, verify)
@@ -105,6 +105,16 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) {
code = CreateTripCode(code)
code = CreateTripCode(code)
+ if code != auth[1] {
+ verify.Identifier = "admin"
+ verify.Board = Domain
+
+ verify = GetVerificationCode(db, verify)
+ code = verify.Code
+ code = CreateTripCode(code)
+ code = CreateTripCode(code)
+ }
+
var rActivity Activity
if validActor && validLocalActor && code == auth[1] || verify.Board == Domain {
rActivity = AcceptFollow(activity)
@@ -500,6 +510,11 @@ func GetActivityFromJson(r *http.Request, db *sql.DB) Activity {
func CheckCaptcha(db *sql.DB, captcha string) bool {
parts := strings.Split(captcha, ":")
+
+ if strings.Trim(parts[0], " ") == "" {
+ return false
+ }
+
path := "public/" + parts[0] + ".png"
code := GetCaptchaCodeDB(db, path)
@@ -529,9 +544,11 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) {
}
if !RemoteActorHasAuth(activity.Actor.Id, auth[1]) {
- response := RejectActivity(activity)
- MakeActivityRequest(db, response)
- return
+ if !RemoteActorHasAuth(Domain, auth[1]) {
+ response := RejectActivity(activity)
+ MakeActivityRequest(db, response)
+ return
+ }
}
switch(activity.Type) {