The open source coding agent.
TypeScript
fix auth
Dax Raad2b014fcd75a6
diff --git a/bun.lock b/bun.lockindex aefcdc2e285..a8d392245ce 100644--- a/bun.lock+++ b/bun.lock@@ -33,6 +33,7 @@"@solidjs/router": "catalog:","@solidjs/start": "catalog:","chart.js": "4.5.1",+ "h3": "2.0.1-rc.4","nitro": "3.0.1-alpha.1","solid-js": "catalog:","vite": "catalog:",diff --git a/packages/console/app/src/routes/auth/callback.ts b/packages/console/app/src/routes/auth/callback.tsindex 23025b54d30..f4096f29452 100644--- a/packages/console/app/src/routes/auth/callback.ts+++ b/packages/console/app/src/routes/auth/callback.ts@@ -1,4 +1,5 @@import { redirect } from "@solidjs/router"+import { getResponseHeaders } from "@solidjs/start/http"import type { APIEvent } from "@solidjs/start/server"import { AuthClient } from "~/context/auth"import { useAuthSession } from "~/context/auth.session"@@ -19,6 +20,7 @@ export async function GET(input: APIEvent) {return {...value,account: {+ ...value.account,[id]: {id,email: decoded.subject.properties.email,@@ -27,5 +29,8 @@ export async function GET(input: APIEvent) {current: id,}})- return redirect("/auth")+ return redirect("/auth/status", {+ status: 302,+ headers: getResponseHeaders(),+ })}diff --git a/packages/console/app/src/routes/auth/status.ts b/packages/console/app/src/routes/auth/status.tsnew file mode 100644index 00000000000..eaab9dbef27--- /dev/null+++ b/packages/console/app/src/routes/auth/status.ts@@ -0,0 +1,7 @@+import { APIEvent } from "@solidjs/start"+import { useAuthSession } from "~/context/auth.session"++export async function GET(input: APIEvent) {+ const session = await useAuthSession()+ return Response.json(session.data)+}