GeezerVison is showing github.com — get rid of extra file · HashNuke/opencode@eaa76da
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: infra/console.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -163,6 +163,7 @@ new sst.cloudflare.x.SolidStart("Console", { | 163 | 163 | AWS_SES_ACCESS_KEY_ID, | 164 | 164 | AWS_SES_SECRET_ACCESS_KEY, | 165 | 165 | ZEN_BLACK, | | 166 | + new sst.Secret("ZEN_SESSION_SECRET"), | 166 | 167 | ...ZEN_MODELS, | 167 | 168 | ...($dev | 168 | 169 | ? [ | |
Collapse file Copy file name to clipboard -24Lines changed: 0 additions & 24 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -import { useSession } from "@solidjs/start/http" | 2 | | - | 3 | | -export interface AuthSession { | 4 | | - account?: Record< | 5 | | - string, | 6 | | - { | 7 | | - id: string | 8 | | - email: string | 9 | | - } | 10 | | - > | 11 | | - current?: string | 12 | | -} | 13 | | - | 14 | | -export function useAuthSession() { | 15 | | - return useSession<AuthSession>({ | 16 | | - password: "0".repeat(32), | 17 | | - name: "auth", | 18 | | - maxAge: 60 * 60 * 24 * 365, | 19 | | - cookie: { | 20 | | - secure: false, | 21 | | - httpOnly: true, | 22 | | - }, | 23 | | - }) | 24 | | -} |
Collapse file Copy file name to clipboardExpand all lines: packages/console/app/src/context/auth.ts +26-1Lines changed: 26 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,13 +5,38 @@ import { redirect } from "@solidjs/router" | 5 | 5 | import { Actor } from "@opencode-ai/console-core/actor.js" | 6 | 6 |
| 7 | 7 | import { createClient } from "@openauthjs/openauth/client" | 8 | | -import { useAuthSession } from "./auth.session" | 9 | 8 |
| 10 | 9 | export const AuthClient = createClient({ | 11 | 10 | clientID: "app", | 12 | 11 | issuer: import.meta.env.VITE_AUTH_URL, | 13 | 12 | }) | 14 | 13 |
| | 14 | +import { useSession } from "@solidjs/start/http" | | 15 | +import { Resource } from "@opencode-ai/console-resource" | | 16 | + | | 17 | +export interface AuthSession { | | 18 | + account?: Record< | | 19 | + string, | | 20 | + { | | 21 | + id: string | | 22 | + email: string | | 23 | + } | | 24 | + > | | 25 | + current?: string | | 26 | +} | | 27 | + | | 28 | +export function useAuthSession() { | | 29 | + return useSession<AuthSession>({ | | 30 | + password: Resource.ZEN_SESSION_SECRET.value, | | 31 | + name: "auth", | | 32 | + maxAge: 60 * 60 * 24 * 365, | | 33 | + cookie: { | | 34 | + secure: false, | | 35 | + httpOnly: true, | | 36 | + }, | | 37 | + }) | | 38 | +} | | 39 | + | 15 | 40 | export const getActor = async (workspace?: string): Promise<Actor.Info> => { | 16 | 41 | "use server" | 17 | 42 | const evt = getRequestEvent() | |
Collapse file Copy file name to clipboardExpand all lines: packages/console/app/src/routes/auth/callback.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { redirect } from "@solidjs/router" | 2 | 2 | import type { APIEvent } from "@solidjs/start/server" | 3 | 3 | import { AuthClient } from "~/context/auth" | 4 | | -import { useAuthSession } from "~/context/auth.session" | | 4 | +import { useAuthSession } from "~/context/auth" | 5 | 5 |
| 6 | 6 | export async function GET(input: APIEvent) { | 7 | 7 | const url = new URL(input.request.url) | |
Collapse file Copy file name to clipboardExpand all lines: packages/console/app/src/routes/auth/logout.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { redirect } from "@solidjs/router" | 2 | 2 | import { APIEvent } from "@solidjs/start" | 3 | | -import { useAuthSession } from "~/context/auth.session" | | 3 | +import { useAuthSession } from "~/context/auth" | 4 | 4 |
| 5 | 5 | export async function GET(event: APIEvent) { | 6 | 6 | const auth = await useAuthSession() | |
Collapse file Copy file name to clipboardExpand all lines: packages/console/app/src/routes/auth/status.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { APIEvent } from "@solidjs/start" | 2 | | -import { useAuthSession } from "~/context/auth.session" | | 2 | +import { useAuthSession } from "~/context/auth" | 3 | 3 |
| 4 | 4 | export async function GET(input: APIEvent) { | 5 | 5 | const session = await useAuthSession() | |
Collapse file Copy file name to clipboardExpand all lines: packages/console/app/src/routes/user-menu.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { action } from "@solidjs/router" | 2 | 2 | import { getRequestEvent } from "solid-js/web" | 3 | | -import { useAuthSession } from "~/context/auth.session" | | 3 | +import { useAuthSession } from "~/context/auth" | 4 | 4 | import { Dropdown } from "~/component/dropdown" | 5 | 5 | import "./user-menu.css" | 6 | 6 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/console/core/sst-env.d.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -130,6 +130,10 @@ declare module "sst" { | 130 | 130 | "type": "sst.sst.Secret" | 131 | 131 | "value": string | 132 | 132 | } | | 133 | + "ZEN_SESSION_SECRET": { | | 134 | + "type": "sst.sst.Secret" | | 135 | + "value": string | | 136 | + } | 133 | 137 | } | 134 | 138 | } | 135 | 139 | // cloudflare | |
Collapse file Copy file name to clipboardExpand all lines: packages/console/function/sst-env.d.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -130,6 +130,10 @@ declare module "sst" { | 130 | 130 | "type": "sst.sst.Secret" | 131 | 131 | "value": string | 132 | 132 | } | | 133 | + "ZEN_SESSION_SECRET": { | | 134 | + "type": "sst.sst.Secret" | | 135 | + "value": string | | 136 | + } | 133 | 137 | } | 134 | 138 | } | 135 | 139 | // cloudflare | |
Collapse file Copy file name to clipboardExpand all lines: packages/console/resource/sst-env.d.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -130,6 +130,10 @@ declare module "sst" { | 130 | 130 | "type": "sst.sst.Secret" | 131 | 131 | "value": string | 132 | 132 | } | | 133 | + "ZEN_SESSION_SECRET": { | | 134 | + "type": "sst.sst.Secret" | | 135 | + "value": string | | 136 | + } | 133 | 137 | } | 134 | 138 | } | 135 | 139 | // cloudflare | |
|