mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 17:11:17 +00:00
fix(backend): remove dev auth bypass (#78)
Always register auth handlers and use requireSession regardless of NODE_ENV. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import { LocationSource } from "@aelis/source-location"
|
|||||||
import { Hono } from "hono"
|
import { Hono } from "hono"
|
||||||
|
|
||||||
import { registerAuthHandlers } from "./auth/http.ts"
|
import { registerAuthHandlers } from "./auth/http.ts"
|
||||||
import { mockAuthSessionMiddleware, requireSession } from "./auth/session-middleware.ts"
|
import { requireSession } from "./auth/session-middleware.ts"
|
||||||
import { registerFeedHttpHandlers } from "./engine/http.ts"
|
import { registerFeedHttpHandlers } from "./engine/http.ts"
|
||||||
import { createFeedEnhancer } from "./enhancement/enhance-feed.ts"
|
import { createFeedEnhancer } from "./enhancement/enhance-feed.ts"
|
||||||
import { createLlmClient } from "./enhancement/llm-client.ts"
|
import { createLlmClient } from "./enhancement/llm-client.ts"
|
||||||
@@ -43,16 +43,11 @@ function main() {
|
|||||||
|
|
||||||
app.get("/health", (c) => c.json({ status: "ok" }))
|
app.get("/health", (c) => c.json({ status: "ok" }))
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV !== "production"
|
registerAuthHandlers(app)
|
||||||
const authSessionMiddleware = isDev ? mockAuthSessionMiddleware("dev-user") : requireSession
|
|
||||||
|
|
||||||
if (!isDev) {
|
|
||||||
registerAuthHandlers(app)
|
|
||||||
}
|
|
||||||
|
|
||||||
registerFeedHttpHandlers(app, {
|
registerFeedHttpHandlers(app, {
|
||||||
sessionManager,
|
sessionManager,
|
||||||
authSessionMiddleware,
|
authSessionMiddleware: requireSession,
|
||||||
})
|
})
|
||||||
registerLocationHttpHandlers(app, { sessionManager })
|
registerLocationHttpHandlers(app, { sessionManager })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user