Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: middleware load auth from url

Nevo David52081c46d52e
diff --git a/apps/frontend/src/middleware.ts b/apps/frontend/src/middleware.ts
index a7f7076d0..1797e737e 100644
--- a/apps/frontend/src/middleware.ts
+++ b/apps/frontend/src/middleware.ts
@@ -6,7 +6,8 @@ import { internalFetch } from '@gitroom/helpers/utils/internal.fetch';
// This function can be marked `async` if using `await` inside
export async function middleware(request: NextRequest) {
const nextUrl = request.nextUrl;
- const authCookie = request.cookies.get('auth');
+ const authCookie = request.cookies.get('auth') || request.headers.get('auth') || nextUrl.searchParams.get('loggedAuth');
+
if (
nextUrl.pathname.startsWith('/uploads/') ||
nextUrl.pathname.startsWith('/p/') ||