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

@@ -8,6 +8,7 @@ import { ErrorCode } from "@documenso/lib/auth";
import { useState } from "react";
import { useRouter } from "next/router";
import { toast, Toaster } from "react-hot-toast";
import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants";
interface LoginValues {
email: string;
@@ -29,7 +30,9 @@ export default function Login() {
// If not absolute URL, make it absolute
if (!/^https?:\/\//.test(callbackUrl)) {
callbackUrl = `https://app.documenso.com/${callbackUrl}`;
if (process.env.NODE_ENV !== "production") {
}
callbackUrl = `${NEXT_PUBLIC_WEBAPP_URL}/${callbackUrl}`;
}
const onSubmit = async (values: LoginValues) => {