Fixes undefined bug by replacing BASE_URL with NEXT_PUBLIC_BASE_URL in Shell and signup. (#1991)
* Replace BASE_URL with NEXT_PUBLIC_BASE_URL in Shell * Replace BASE_URL with NEXT_PUBLIC_BASE_URL in apps/web/pages/auth/signup Co-authored-by: Agusti Fernandez Pardo <git@agusti.me> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/1994/head^2
parent
981fb9c5be
commit
eb59908c84
|
@ -22,7 +22,7 @@ import TrialBanner from "@ee/components/TrialBanner";
|
||||||
import HelpMenuItemDynamic from "@ee/lib/intercom/HelpMenuItemDynamic";
|
import HelpMenuItemDynamic from "@ee/lib/intercom/HelpMenuItemDynamic";
|
||||||
|
|
||||||
import classNames from "@lib/classNames";
|
import classNames from "@lib/classNames";
|
||||||
import { BASE_URL } from "@lib/config/constants";
|
import { NEXT_PUBLIC_BASE_URL } from "@lib/config/constants";
|
||||||
import { shouldShowOnboarding } from "@lib/getting-started";
|
import { shouldShowOnboarding } from "@lib/getting-started";
|
||||||
import { useLocale } from "@lib/hooks/useLocale";
|
import { useLocale } from "@lib/hooks/useLocale";
|
||||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||||
|
@ -62,7 +62,7 @@ function useRedirectToLoginIfUnauthenticated() {
|
||||||
router.replace({
|
router.replace({
|
||||||
pathname: "/auth/login",
|
pathname: "/auth/login",
|
||||||
query: {
|
query: {
|
||||||
callbackUrl: `${BASE_URL}/${location.pathname}${location.search}`,
|
callbackUrl: `${NEXT_PUBLIC_BASE_URL}/${location.pathname}${location.search}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ function UserDropdown({ small }: { small?: boolean }) {
|
||||||
<img
|
<img
|
||||||
className="rounded-full"
|
className="rounded-full"
|
||||||
src={
|
src={
|
||||||
(process.env.NEXT_PUBLIC_APP_URL || process.env.BASE_URL) +
|
(process.env.NEXT_PUBLIC_APP_URL || process.env.NEXT_PUBLIC_BASE_URL) +
|
||||||
"/" +
|
"/" +
|
||||||
user?.username +
|
user?.username +
|
||||||
"/avatar.png"
|
"/avatar.png"
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useRouter } from "next/router";
|
||||||
import { FormProvider, SubmitHandler, useForm } from "react-hook-form";
|
import { FormProvider, SubmitHandler, useForm } from "react-hook-form";
|
||||||
|
|
||||||
import { asStringOrNull } from "@lib/asStringOrNull";
|
import { asStringOrNull } from "@lib/asStringOrNull";
|
||||||
import { BASE_URL } from "@lib/config/constants";
|
import { NEXT_PUBLIC_BASE_URL } from "@lib/config/constants";
|
||||||
import { useLocale } from "@lib/hooks/useLocale";
|
import { useLocale } from "@lib/hooks/useLocale";
|
||||||
import prisma from "@lib/prisma";
|
import prisma from "@lib/prisma";
|
||||||
import { isSAMLLoginEnabled } from "@lib/saml";
|
import { isSAMLLoginEnabled } from "@lib/saml";
|
||||||
|
@ -60,7 +60,7 @@ export default function Signup({ email }: Props) {
|
||||||
.then(
|
.then(
|
||||||
async () =>
|
async () =>
|
||||||
await signIn("Cal.com", {
|
await signIn("Cal.com", {
|
||||||
callbackUrl: (`${BASE_URL}/${router.query.callbackUrl}` || "") as string,
|
callbackUrl: (`${NEXT_PUBLIC_BASE_URL}/${router.query.callbackUrl}` || "") as string,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@ -130,7 +130,7 @@ export default function Signup({ email }: Props) {
|
||||||
className="w-5/12 justify-center"
|
className="w-5/12 justify-center"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
signIn("Cal.com", {
|
signIn("Cal.com", {
|
||||||
callbackUrl: (`${BASE_URL}/${router.query.callbackUrl}` || "") as string,
|
callbackUrl: (`${NEXT_PUBLIC_BASE_URL}/${router.query.callbackUrl}` || "") as string,
|
||||||
})
|
})
|
||||||
}>
|
}>
|
||||||
{t("login_instead")}
|
{t("login_instead")}
|
||||||
|
@ -184,7 +184,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
permanent: false,
|
permanent: false,
|
||||||
destination: "/auth/login?callbackUrl=" + `${BASE_URL}/${ctx.query.callbackUrl}`,
|
destination: "/auth/login?callbackUrl=" + `${NEXT_PUBLIC_BASE_URL}/${ctx.query.callbackUrl}`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue