This commit is contained in:
Dax Raad 2025-11-22 23:53:32 -05:00
parent c2bf6975f8
commit 2b014fcd75
3 changed files with 14 additions and 1 deletions

View file

@ -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:",

View file

@ -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(),
})
}

View file

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