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/SSOPage.tsx | |
| download | umami-main.tar.xz umami-main.zip | |
Created from https://vercel.com/new
Diffstat (limited to 'src/app/sso/SSOPage.tsx')
| -rw-r--r-- | src/app/sso/SSOPage.tsx | 22 |
1 files changed, 22 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" />; +} |