0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(core): fix next server action guide (#5179)

This commit is contained in:
wangsijie 2024-01-10 10:56:19 +08:00 committed by GitHub
parent cbc5dc5792
commit 4022e4dbc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,7 @@ const config = {
cookieSecure: process.env.NODE_ENV === 'production',
};
export const logtoClient = new LogtoClient(config);`}
const logtoClient = new LogtoClient(config);`}
</code>
</pre>
@ -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('/');
});