diff options
| author | Fuwn <[email protected]> | 2026-01-24 13:09:50 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-24 13:09:50 +0000 |
| commit | 396acf3bbbe00a192cb0ea0a9ccf91b1d8d2850b (patch) | |
| tree | b9df4ca6a70db45cfffbae6fdd7252e20fb8e93c /src/app/sso | |
| download | umami-main.tar.xz umami-main.zip | |
Created from https://vercel.com/new
Diffstat (limited to 'src/app/sso')
| -rw-r--r-- | src/app/sso/SSOPage.tsx | 22 | ||||
| -rw-r--r-- | src/app/sso/page.tsx | 10 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/app/sso/SSOPage.tsx b/src/app/sso/SSOPage.tsx new file mode 100644 index 0000000..3cc9509 --- /dev/null +++ b/src/app/sso/SSOPage.tsx @@ -0,0 +1,22 @@ +'use client'; +import { Loading } from '@umami/react-zen'; +import { useRouter, useSearchParams } from 'next/navigation'; +import { useEffect } from 'react'; +import { setClientAuthToken } from '@/lib/client'; + +export 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 placement="absolute" />; +} diff --git a/src/app/sso/page.tsx b/src/app/sso/page.tsx new file mode 100644 index 0000000..f6290d4 --- /dev/null +++ b/src/app/sso/page.tsx @@ -0,0 +1,10 @@ +import { Suspense } from 'react'; +import { SSOPage } from './SSOPage'; + +export default function () { + return ( + <Suspense> + <SSOPage /> + </Suspense> + ); +} |