mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(core): fix next server action guide (#5179)
This commit is contained in:
parent
cbc5dc5792
commit
4022e4dbc7
1 changed files with 6 additions and 1 deletions
|
@ -63,7 +63,7 @@ const config = {
|
||||||
cookieSecure: process.env.NODE_ENV === 'production',
|
cookieSecure: process.env.NODE_ENV === 'production',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const logtoClient = new LogtoClient(config);`}
|
const logtoClient = new LogtoClient(config);`}
|
||||||
</code>
|
</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
@ -181,8 +181,13 @@ type Props = {
|
||||||
|
|
||||||
export default function Callback({ searchParams }: Props) {
|
export default function Callback({ searchParams }: Props) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const redirectinRef = React.useRef(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (redirectinRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
redirectinRef.current = true;
|
||||||
handleSignIn(searchParams).then(() => {
|
handleSignIn(searchParams).then(() => {
|
||||||
router.push('/');
|
router.push('/');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue