0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): remove url queries for social demo callback (#3621)

This commit is contained in:
wangsijie 2023-03-30 18:17:44 +08:00 committed by GitHub
parent 9663852f1e
commit 2ed3e672de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
import { Theme } from '@logto/schemas';
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router-dom';
import CongratsDark from '@/assets/images/congrats-dark.svg';
import Congrats from '@/assets/images/congrats.svg';
@ -11,6 +13,14 @@ import * as styles from './index.module.scss';
function SocialDemoCallback() {
const theme = useTheme();
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const [searchParams, setSearchParams] = useSearchParams();
useEffect(() => {
// Social callback will have "code" in query params
if (searchParams.get('code')) {
setSearchParams({}, { replace: true });
}
}, [searchParams, setSearchParams]);
return (
<div className={styles.container}>