From 4022e4dbc70cc1fcd5498513b2c03ab4405c25f9 Mon Sep 17 00:00:00 2001 From: wangsijie Date: Wed, 10 Jan 2024 10:56:19 +0800 Subject: [PATCH] fix(core): fix next server action guide (#5179) --- .../assets/docs/guides/web-next-server-actions/README.mdx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/console/src/assets/docs/guides/web-next-server-actions/README.mdx b/packages/console/src/assets/docs/guides/web-next-server-actions/README.mdx index 1ecfb34a0..fcf92e4e8 100644 --- a/packages/console/src/assets/docs/guides/web-next-server-actions/README.mdx +++ b/packages/console/src/assets/docs/guides/web-next-server-actions/README.mdx @@ -63,7 +63,7 @@ const config = { cookieSecure: process.env.NODE_ENV === 'production', }; -export const logtoClient = new LogtoClient(config);`} +const logtoClient = new LogtoClient(config);`} @@ -181,8 +181,13 @@ type Props = { export default function Callback({ searchParams }: Props) { const router = useRouter(); + const redirectinRef = React.useRef(false); useEffect(() => { + if (redirectinRef.current) { + return; + } + redirectinRef.current = true; handleSignIn(searchParams).then(() => { router.push('/'); });