Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol diffdown.com

fix: hide raw SQL error on consumed invite, fix already-collaborator redirect URL

+4 -3
+4 -3
internal/handler/handler.go
··· 621 621 622 622 invite, err := collaboration.ValidateInvite(h.DB, inviteToken, rKey) 623 623 if err != nil { 624 - http.Error(w, err.Error(), http.StatusBadRequest) 624 + log.Printf("AcceptInvite: validate invite rkey=%s: %v", rKey, err) 625 + http.Error(w, "Invite not found, already used, or expired.", http.StatusBadRequest) 625 626 return 626 627 } 627 628 ··· 655 656 return 656 657 } 657 658 658 - // Already a collaborator — just redirect. 659 + // Already a collaborator — redirect to the owner-scoped URL. 659 660 for _, c := range doc.Collaborators { 660 661 if c == collabSession.DID { 661 - http.Redirect(w, r, "/docs/"+rKey, http.StatusSeeOther) 662 + http.Redirect(w, r, "/docs/"+invite.CreatedBy+"/"+rKey, http.StatusSeeOther) 662 663 return 663 664 } 664 665 }