mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
Fix desktop OAuth return redirect
This commit is contained in:
parent
33adc849aa
commit
a800c2a77e
2 changed files with 8 additions and 2 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue