From a800c2a77eb6940b3539ae2c4499f2de9e5c2f4d Mon Sep 17 00:00:00 2001 From: Sreeram Sreedhar Date: Tue, 23 Jun 2026 13:34:21 -0700 Subject: [PATCH] Fix desktop OAuth return redirect --- apps/desktop/src-tauri/src/auth.rs | 6 ++++-- apps/web/middleware.ts | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src-tauri/src/auth.rs b/apps/desktop/src-tauri/src/auth.rs index 8f7b2789..43a76321 100644 --- a/apps/desktop/src-tauri/src/auth.rs +++ b/apps/desktop/src-tauri/src/auth.rs @@ -247,6 +247,7 @@ where .json(&serde_json::json!({ "provider": provider, "callbackURL": request.finish_url, + "newUserCallbackURL": request.finish_url, "errorCallbackURL": request.finish_url, })) .send() @@ -292,6 +293,7 @@ where .json(&serde_json::json!({ "email": email, "callbackURL": request.finish_url, + "newUserCallbackURL": request.finish_url, "errorCallbackURL": request.finish_url, })) .send() @@ -558,8 +560,8 @@ where Ok(_) => write_loopback_response( &mut stream, 200, - "Authentication successful", - "You can close this window and return to Supermemory.", + "You are authenticated", + "You can close this window and go back to Supermemory.", ), Err(error) => { write_loopback_response( diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index 2094e5aa..4393632f 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -36,6 +36,10 @@ export default async function proxy(request: Request) { return NextResponse.next() } + if (url.pathname === "/api/auth/desktop/callback") { + return NextResponse.next() + } + if (url.pathname.startsWith("/api/")) { if (!sessionCookie) { console.debug("[MIDDLEWARE] API route without session, returning 401")