Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/oak/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["denoland.vscode-deno"]
}
5 changes: 4 additions & 1 deletion apps/oak/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"format": "deno fmt"
},
"imports": {
"@/": "./src/",
"@oak/oak": "jsr:@oak/oak@^17.2.0"
},
"exports": "./src/index.ts",
"exports": {
".": "./src/index.ts"
},
"fmt": {
"semiColons": false,
"indentWidth": 4,
Expand Down
7 changes: 3 additions & 4 deletions apps/oak/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Application, Router } from "@oak/oak"
import { toOakHandler } from "./lib/handler.ts"
import { type GlobalState, withAuth } from "./middleware/with-auth.ts"
import { withAuth, toHandler } from "@/lib/auth.ts"

const router = new Router<GlobalState>()
const router = new Router()
const app = new Application()

router.get("/", (ctx) => {
ctx.response.body = "Welcome to Aura Auth Oak App!"
})

router.all("/api/auth/(.*)", toOakHandler)
router.all("/api/auth/(.*)", toHandler)

router.get("/api/protected", withAuth, (ctx) => {
ctx.response.body = {
Expand Down
4 changes: 2 additions & 2 deletions apps/oak/src/auth.ts → apps/oak/src/lib/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createAuth } from "@aura-stack/auth"
import { createAuth } from "@aura-stack/oak"

export const { handlers, jose, api } = createAuth({
export const { handlers, jose, api, toHandler, withAuth } = createAuth({
oauth: ["github"],
basePath: "/api/auth",
trustedOrigins: ["http://localhost:3000", "https://*.vercel.app"],
Expand Down
34 changes: 0 additions & 34 deletions apps/oak/src/lib/handler.ts

This file was deleted.

7 changes: 0 additions & 7 deletions apps/oak/src/lib/utils.ts

This file was deleted.

36 changes: 0 additions & 36 deletions apps/oak/src/middleware/with-auth.ts

This file was deleted.

27 changes: 20 additions & 7 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"workspace": ["packages/**", "!packages/integration", "configs/**", "apps/oak", "apps/deno", "apps/supabase/**"]
"workspace": ["packages/**", "!packages/integration", "configs/**", "apps/oak", "apps/deno", "apps/supabase/**"],
"nodeModulesDir": "auto"
}
Loading
Loading