mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44:21 +01:00
ignore: create key for new workspace
This commit is contained in:
7
cloud/app/src/routes/auth/logout.ts
Normal file
7
cloud/app/src/routes/auth/logout.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import type { APIEvent } from "@solidjs/start/server"
|
||||||
|
import { AuthClient } from "~/context/auth"
|
||||||
|
|
||||||
|
export async function GET(input: APIEvent) {
|
||||||
|
const result = await AuthClient.authorize(new URL("./callback", input.request.url).toString(), "code")
|
||||||
|
return Response.redirect(result.url, 302)
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import { Identifier } from "./identifier"
|
|||||||
import { UserTable } from "./schema/user.sql"
|
import { UserTable } from "./schema/user.sql"
|
||||||
import { BillingTable } from "./schema/billing.sql"
|
import { BillingTable } from "./schema/billing.sql"
|
||||||
import { WorkspaceTable } from "./schema/workspace.sql"
|
import { WorkspaceTable } from "./schema/workspace.sql"
|
||||||
|
import { Key } from "./key"
|
||||||
|
|
||||||
export namespace Workspace {
|
export namespace Workspace {
|
||||||
export const create = fn(z.void(), async () => {
|
export const create = fn(z.void(), async () => {
|
||||||
@@ -28,6 +29,15 @@ export namespace Workspace {
|
|||||||
balance: centsToMicroCents(100),
|
balance: centsToMicroCents(100),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
await Actor.provide(
|
||||||
|
"system",
|
||||||
|
{
|
||||||
|
workspaceID,
|
||||||
|
},
|
||||||
|
async () => {
|
||||||
|
await Key.create({ name: "Default API Key" })
|
||||||
|
},
|
||||||
|
)
|
||||||
return workspaceID
|
return workspaceID
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user