configurable NEXT_PUBLIC_WEBAPP_URL

This commit is contained in:
Timur Ercan
2023-01-16 14:25:55 +01:00
parent b4f795ad10
commit 801548cbd6
5 changed files with 10 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import { Disclosure, Menu, Transition } from "@headlessui/react";
import Link from "next/link";
import { useRouter } from "next/router";
import { signOut, useSession } from "next-auth/react";
import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants";
import Navigation from "./navigation";
@ -16,7 +17,7 @@ function useRedirectToLoginIfUnauthenticated() {
router.replace({
pathname: "/login",
query: {
callbackUrl: `https://app.documenso.com/${location.pathname}${location.search}`,
callbackUrl: `${NEXT_PUBLIC_WEBAPP_URL}/${location.pathname}${location.search}`,
},
});
}