feat: add NEXT_PUBLIC_APP_URL env variable

This commit is contained in:
shadcn 2022-11-21 18:46:49 +04:00
parent a0819e58a2
commit d90086046f
2 changed files with 3 additions and 3 deletions

View file

@ -1,3 +1,5 @@
NEXT_PUBLIC_APP_URL=http://localhost:3000
# -----------------------------------------------------------------------------
# Authentication (NextAuth.js)
# -----------------------------------------------------------------------------
@ -6,7 +8,6 @@ NEXTAUTH_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_ACCESS_TOKEN=
# -----------------------------------------------------------------------------

View file

@ -14,7 +14,6 @@ export function formatDate(input: string | number): string {
})
}
// Since we're already setting NEXTAUTH_URL, we can use same to create absolute URLs.
export function absoluteUrl(path: string) {
return `${process.env.NEXTAUTH_URL}${path}`
return `${process.env.NEXT_PUBLIC_APP_URL}${path}`
}