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:
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',
|
||||
};
|
||||
|
||||
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('/');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue