Fix desktop OAuth return redirect

This commit is contained in:
Sreeram Sreedhar 2026-06-23 13:34:21 -07:00
parent 33adc849aa
commit a800c2a77e
2 changed files with 8 additions and 2 deletions

View file

@ -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(

View file

@ -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")