mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
use SITE_URL via helper instead of custom env var
This commit is contained in:
@@ -41,7 +41,6 @@ Auth is handled by `better-auth` via `lib/auth.ts` (server) and `lib/auth-client
|
|||||||
- `MONGO_URI` — MongoDB connection string
|
- `MONGO_URI` — MongoDB connection string
|
||||||
- `ADMIN_EMAIL` — Only email allowed to log in
|
- `ADMIN_EMAIL` — Only email allowed to log in
|
||||||
- `BETTER_AUTH_SECRET` — Auth secret key
|
- `BETTER_AUTH_SECRET` — Auth secret key
|
||||||
- `BETTER_AUTH_URL` — Auth base URL (defaults to `http://localhost:3000`)
|
|
||||||
- `GITHUB_CLIENT_ID` / `GITHUB_CLIENT_SECRET` — GitHub OAuth app (optional)
|
- `GITHUB_CLIENT_ID` / `GITHUB_CLIENT_SECRET` — GitHub OAuth app (optional)
|
||||||
- `NEXT_PUBLIC_GITHUB_ENABLED` — Set to enable GitHub OAuth login on the client
|
- `NEXT_PUBLIC_GITHUB_ENABLED` — Set to enable GitHub OAuth login on the client
|
||||||
- `SMTP_USER` / `SMTP_PASS` / `FROM_EMAIL` — Email via wirtanen.uberspace.de:465
|
- `SMTP_USER` / `SMTP_PASS` / `FROM_EMAIL` — Email via wirtanen.uberspace.de:465
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { getBaseURL } from "../../../helpers/url"
|
||||||
import { auth } from "../../../lib/auth"
|
import { auth } from "../../../lib/auth"
|
||||||
import type { NextApiRequest, NextApiResponse } from "next"
|
import type { NextApiRequest, NextApiResponse } from "next"
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ export const config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
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)
|
const url = new URL(req.url!, baseUrl)
|
||||||
|
|
||||||
let body: Buffer | undefined
|
let body: Buffer | undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user