mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
feat: relay invite links (mint + claim + landing page + deep link) (#1668)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
@@ -68,6 +68,9 @@ pub fn build_router(state: Arc<AppState>) -> Router {
|
||||
"/operator/communities/availability",
|
||||
get(api::operator::community_availability),
|
||||
)
|
||||
// Relay invites: mint (owner/admin) + claim (membership-gate exempt)
|
||||
.route("/api/invites", post(api::invites::mint_invite))
|
||||
.route("/api/invites/claim", post(api::invites::claim_invite))
|
||||
// Moderation queue reads (NIP-98 auth + mod-authz gate, L6)
|
||||
.route("/moderation/reports", get(api::bridge::moderation_reports))
|
||||
.route("/moderation/audit", get(api::bridge::moderation_audit))
|
||||
@@ -115,7 +118,10 @@ pub fn build_router(state: Arc<AppState>) -> Router {
|
||||
|| path == "/_status"
|
||||
|| path == "/info";
|
||||
// Files with extensions (e.g. /assets/missing.js) should 404.
|
||||
let has_ext = path.rsplit('/').next().is_some_and(|seg| seg.contains('.'));
|
||||
// Exception: /invite/<code> — invite codes contain a "."
|
||||
// (payload.mac separator) but are SPA routes, not files.
|
||||
let has_ext = !path.starts_with("/invite/")
|
||||
&& path.rsplit('/').next().is_some_and(|seg| seg.contains('.'));
|
||||
if reserved || has_ext {
|
||||
Ok(StatusCode::NOT_FOUND.into_response())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user