mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +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 { useEffect } from 'react';
|
||||
import { Loading } from 'react-basics';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { setClientAuthToken } from 'lib/client';
|
||||
import SSOPage from './SSOPage';
|
||||
|
||||
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 />;
|
||||
export default function () {
|
||||
return <SSOPage />;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user