mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 06:57:12 +01:00
use SITE_URL via helper instead of custom env var
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getBaseURL } from "../../../helpers/url"
|
||||
import { auth } from "../../../lib/auth"
|
||||
import type { NextApiRequest, NextApiResponse } from "next"
|
||||
|
||||
@@ -8,7 +9,7 @@ export const config = {
|
||||
}
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const baseUrl = process.env.BETTER_AUTH_URL || "http://localhost:3000"
|
||||
const baseUrl = getBaseURL()
|
||||
const url = new URL(req.url!, baseUrl)
|
||||
|
||||
let body: Buffer | undefined
|
||||
@@ -34,4 +35,4 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
res.setHeader(key, value)
|
||||
})
|
||||
res.end(await response.text())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user