GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — get rid of extra file · HashNuke/opencode@eaa76da

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • infra
    • console.ts
  • packages
    • console
      • app/src
        • context
          • auth.session.ts
          • auth.ts
        • routes
          • auth
            • callback.ts
            • logout.ts
            • status.ts
          • user-menu.tsx
      • core
        • sst-env.d.ts
      • function
        • sst-env.d.ts
      • resource
        • sst-env.d.ts
    • enterprise
      • sst-env.d.ts
    • function
      • sst-env.d.ts
  • sst-env.d.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎infra/console.ts‎

Copy file name to clipboardExpand all lines: infra/console.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ new sst.cloudflare.x.SolidStart("Console", {
163163
AWS_SES_ACCESS_KEY_ID,
164164
AWS_SES_SECRET_ACCESS_KEY,
165165
ZEN_BLACK,
166+
new sst.Secret("ZEN_SESSION_SECRET"),
166167
...ZEN_MODELS,
167168
...($dev
168169
? [
Collapse file

‎packages/console/app/src/context/auth.session.ts‎

Copy file name to clipboard
-24Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +0,0 @@
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

‎packages/console/app/src/context/auth.ts‎

Copy file name to clipboardExpand all lines: packages/console/app/src/context/auth.ts
+26-1Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,38 @@ import { redirect } from "@solidjs/router"
55
import { Actor } from "@opencode-ai/console-core/actor.js"
66

77
import { createClient } from "@openauthjs/openauth/client"
8-
import { useAuthSession } from "./auth.session"
98

109
export const AuthClient = createClient({
1110
clientID: "app",
1211
issuer: import.meta.env.VITE_AUTH_URL,
1312
})
1413

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+
1540
export const getActor = async (workspace?: string): Promise<Actor.Info> => {
1641
"use server"
1742
const evt = getRequestEvent()
Collapse file

‎packages/console/app/src/routes/auth/callback.ts‎

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 numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { redirect } from "@solidjs/router"
22
import type { APIEvent } from "@solidjs/start/server"
33
import { AuthClient } from "~/context/auth"
4-
import { useAuthSession } from "~/context/auth.session"
4+
import { useAuthSession } from "~/context/auth"
55

66
export async function GET(input: APIEvent) {
77
const url = new URL(input.request.url)
Collapse file

‎packages/console/app/src/routes/auth/logout.ts‎

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 numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { redirect } from "@solidjs/router"
22
import { APIEvent } from "@solidjs/start"
3-
import { useAuthSession } from "~/context/auth.session"
3+
import { useAuthSession } from "~/context/auth"
44

55
export async function GET(event: APIEvent) {
66
const auth = await useAuthSession()
Collapse file

‎packages/console/app/src/routes/auth/status.ts‎

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 numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { APIEvent } from "@solidjs/start"
2-
import { useAuthSession } from "~/context/auth.session"
2+
import { useAuthSession } from "~/context/auth"
33

44
export async function GET(input: APIEvent) {
55
const session = await useAuthSession()
Collapse file

‎packages/console/app/src/routes/user-menu.tsx‎

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 numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { action } from "@solidjs/router"
22
import { getRequestEvent } from "solid-js/web"
3-
import { useAuthSession } from "~/context/auth.session"
3+
import { useAuthSession } from "~/context/auth"
44
import { Dropdown } from "~/component/dropdown"
55
import "./user-menu.css"
66

Collapse file

‎packages/console/core/sst-env.d.ts‎

Copy file name to clipboardExpand all lines: packages/console/core/sst-env.d.ts
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ declare module "sst" {
130130
"type": "sst.sst.Secret"
131131
"value": string
132132
}
133+
"ZEN_SESSION_SECRET": {
134+
"type": "sst.sst.Secret"
135+
"value": string
136+
}
133137
}
134138
}
135139
// cloudflare
Collapse file

‎packages/console/function/sst-env.d.ts‎

Copy file name to clipboardExpand all lines: packages/console/function/sst-env.d.ts
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ declare module "sst" {
130130
"type": "sst.sst.Secret"
131131
"value": string
132132
}
133+
"ZEN_SESSION_SECRET": {
134+
"type": "sst.sst.Secret"
135+
"value": string
136+
}
133137
}
134138
}
135139
// cloudflare
Collapse file

‎packages/console/resource/sst-env.d.ts‎

Copy file name to clipboardExpand all lines: packages/console/resource/sst-env.d.ts
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ declare module "sst" {
130130
"type": "sst.sst.Secret"
131131
"value": string
132132
}
133+
"ZEN_SESSION_SECRET": {
134+
"type": "sst.sst.Secret"
135+
"value": string
136+
}
133137
}
134138
}
135139
// cloudflare

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.