mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 18:00:17 +01:00
Split up sso page.
This commit is contained in:
parent
b76f4aa42d
commit
007625ecf7
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