diff --git a/handler.go b/handler.go index 5d655a4..0cf5d0d 100644 --- a/handler.go +++ b/handler.go @@ -24,7 +24,7 @@ func addToWhitelistHandler(w http.ResponseWriter, r *http.Request) { pubkey = value.(string) } - if hasInvitedAtLeast(loggedUser, s.MaxInvitesPerPerson) { + if loggedUser != s.RelayPubkey && hasInvitedAtLeast(loggedUser, s.MaxInvitesPerPerson) { http.Error(w, fmt.Sprintf("cannot invite more than %d", s.MaxInvitesPerPerson), 403) return } diff --git a/pages.go b/pages.go index e51eb18..3a84870 100644 --- a/pages.go +++ b/pages.go @@ -51,7 +51,7 @@ type InviteTreePageParams struct { func inviteTreePageHTML(ctx context.Context, params InviteTreePageParams) HTMLComponent { inviteForm := Div() - if params.loggedUser != "" && !hasInvitedAtLeast(params.loggedUser, s.MaxInvitesPerPerson) { + if params.loggedUser != "" && (params.loggedUser == s.RelayPubkey || !hasInvitedAtLeast(params.loggedUser, s.MaxInvitesPerPerson)) { inviteForm = Form( Input("pubkey").Type("text").Placeholder("npub1...").Class("w-96 rounded-md border-0 p-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600"), Button("invite").Class(buttonClass+" ml-2 p-2 bg-white hover:bg-gray-50"),