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:
parent
9663852f1e
commit
2ed3e672de
1 changed files with 10 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
import { Theme } from '@logto/schemas';
|
import { Theme } from '@logto/schemas';
|
||||||
|
import { useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
import CongratsDark from '@/assets/images/congrats-dark.svg';
|
import CongratsDark from '@/assets/images/congrats-dark.svg';
|
||||||
import Congrats from '@/assets/images/congrats.svg';
|
import Congrats from '@/assets/images/congrats.svg';
|
||||||
|
@ -11,6 +13,14 @@ import * as styles from './index.module.scss';
|
||||||
function SocialDemoCallback() {
|
function SocialDemoCallback() {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
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 (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
|
|
Loading…
Reference in a new issue