Skip to content

Commit

Permalink
feat: remove frontend url from register
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevo David committed Sep 16, 2024
1 parent f9bc501 commit 717cb51
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions apps/frontend/src/components/auth/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export function RegisterAfter({
provider: string;
}) {
const [loading, setLoading] = useState(false);
const getQuery = useSearchParams();
const router = useRouter();
const fireEvents = useFireEvents();

Expand Down Expand Up @@ -116,17 +115,6 @@ export function RegisterAfter({
}
};

const rootDomain = useMemo(() => {
const url = new URL(process.env.frontendUrl!);
const hostname = url.hostname;
const parts = hostname.split('.');
if (parts.length > 2) {
return url.protocol + '//' + url.hostname?.replace(/^[^.]+\./, '');
}

return process.env.frontendUrl;
}, []);

return (
<FormProvider {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
Expand Down Expand Up @@ -175,14 +163,14 @@ export function RegisterAfter({
<div className={clsx('text-[12px]', interClass)}>
By registering you agree to our{' '}
<a
href={`${rootDomain}/terms`}
href={`https://postiz.com/terms`}
className="underline hover:font-bold"
>
Terms of Service
</a>{' '}
and{' '}
<a
href={`${rootDomain}/privacy`}
href={`https://postiz.com/privacy`}
className="underline hover:font-bold"
>
Privacy Policy
Expand Down

0 comments on commit 717cb51

Please sign in to comment.