mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
19 lines
395 B
JavaScript
19 lines
395 B
JavaScript
import { useEffect } from 'react';
|
|
import { useRouter } from 'next/router';
|
|
import { setClientAuthToken } from 'lib/client';
|
|
|
|
export default function SingleSignOnPage() {
|
|
const router = useRouter();
|
|
const { token, url } = router.query;
|
|
|
|
useEffect(() => {
|
|
if (url && token) {
|
|
setClientAuthToken(token);
|
|
|
|
router.push(url);
|
|
}
|
|
}, [router, url, token]);
|
|
|
|
return null;
|
|
}
|