mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-26 12:29:05 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
commit
b1dae9c484
22
src/app/sso/SSOPage.tsx
Normal file
22
src/app/sso/SSOPage.tsx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
'use client';
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { Loading } from 'react-basics';
|
||||||
|
import { useRouter, useSearchParams } from 'next/navigation';
|
||||||
|
import { setClientAuthToken } from 'lib/client';
|
||||||
|
|
||||||
|
export default function SSOPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const search = useSearchParams();
|
||||||
|
const url = search.get('url');
|
||||||
|
const token = search.get('token');
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (url && token) {
|
||||||
|
setClientAuthToken(token);
|
||||||
|
|
||||||
|
router.push(url);
|
||||||
|
}
|
||||||
|
}, [router, url, token]);
|
||||||
|
|
||||||
|
return <Loading />;
|
||||||
|
}
|
@ -1,22 +1,5 @@
|
|||||||
'use client';
|
import SSOPage from './SSOPage';
|
||||||
import { useEffect } from 'react';
|
|
||||||
import { Loading } from 'react-basics';
|
|
||||||
import { useRouter, useSearchParams } from 'next/navigation';
|
|
||||||
import { setClientAuthToken } from 'lib/client';
|
|
||||||
|
|
||||||
export default function SSOPage() {
|
export default function () {
|
||||||
const router = useRouter();
|
return <SSOPage />;
|
||||||
const search = useSearchParams();
|
|
||||||
const url = search.get('url');
|
|
||||||
const token = search.get('token');
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (url && token) {
|
|
||||||
setClientAuthToken(token);
|
|
||||||
|
|
||||||
router.push(url);
|
|
||||||
}
|
|
||||||
}, [router, url, token]);
|
|
||||||
|
|
||||||
return <Loading />;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user