a tool for shared writing and social publishing

don't do auth redirects for feed routes

+6 -1
+6 -1
middleware.ts
··· 41 41 42 42 let pub = routes?.publication_domains[0]?.publications; 43 43 if (pub) { 44 + if (req.nextUrl.pathname.startsWith("/lish")) return; 44 45 let cookie = req.cookies.get("external_auth_token"); 46 + let isStaticReq = 47 + req.nextUrl.pathname.includes("/rss") || 48 + req.nextUrl.pathname.includes("/atom") || 49 + req.nextUrl.pathname.includes("/json"); 45 50 if ( 51 + !isStaticReq && 46 52 (!cookie || req.nextUrl.searchParams.has("refreshAuth")) && 47 53 !req.nextUrl.searchParams.has("auth_completed") && 48 54 !hostname.includes("leaflet.pub") ··· 50 56 return initiateAuthCallback(req); 51 57 } 52 58 let aturi = new AtUri(pub?.uri); 53 - if (req.nextUrl.pathname.startsWith("/lish")) return; 54 59 return NextResponse.rewrite( 55 60 new URL( 56 61 `/lish/${aturi.host}/${encodeURIComponent(pub.name)}${req.nextUrl.pathname}`,