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