2022-10-31 19:02:37 +01:00
|
|
|
import { useEffect } from 'react';
|
2023-01-31 06:44:07 +01:00
|
|
|
import { Loading } from 'react-basics';
|
2022-10-31 19:02:37 +01:00
|
|
|
import { useRouter } from 'next/router';
|
2022-12-29 00:43:22 +01:00
|
|
|
import { setClientAuthToken } from 'lib/client';
|
2022-10-31 19:02:37 +01:00
|
|
|
|
2023-07-10 09:33:30 +02:00
|
|
|
export default function () {
|
2022-10-31 19:02:37 +01:00
|
|
|
const router = useRouter();
|
|
|
|
const { token, url } = router.query;
|
|
|
|
|
|
|
|
useEffect(() => {
|
2022-11-09 07:58:52 +01:00
|
|
|
if (url && token) {
|
2022-12-29 00:43:22 +01:00
|
|
|
setClientAuthToken(token);
|
2022-10-31 19:02:37 +01:00
|
|
|
|
2023-04-07 05:35:55 +02:00
|
|
|
router.push(url);
|
2022-10-31 19:02:37 +01:00
|
|
|
}
|
2023-04-07 05:35:55 +02:00
|
|
|
}, [router, url, token]);
|
2022-10-31 19:02:37 +01:00
|
|
|
|
2023-01-31 06:44:07 +01:00
|
|
|
return <Loading size="xl" />;
|
2022-10-31 19:02:37 +01:00
|
|
|
}
|