Perf improvements and billing updates

This commit is contained in:
giancarlo
2024-03-26 16:49:11 +08:00
parent 8626ea30c7
commit 4032aed827
39 changed files with 1261 additions and 1090 deletions

View File

@@ -1,6 +1,6 @@
'use client';
import { useRouter } from 'next/navigation';
import { useRouter, useSearchParams } from 'next/navigation';
import type { Provider } from '@supabase/supabase-js';
@@ -27,13 +27,17 @@ export function SignInMethodsContainer(props: {
oAuth: Provider[];
};
}) {
const router = useRouter();
const nextPath = useSearchParams().get('next') ?? props.paths.home;
const redirectUrl = new URL(
props.paths.callback,
isBrowser() ? window?.location.origin : '',
).toString();
const router = useRouter();
const onSignIn = () => router.replace(props.paths.home);
const onSignIn = () => {
router.replace(nextPath);
};
return (
<>