0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

fix(ui): social bind account should back to sign-in page (#952)

social bind account should back to sign-in page
This commit is contained in:
simeng-li 2022-05-26 10:06:25 +08:00 committed by GitHub
parent fa14589440
commit da41369bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,7 @@ const useSocial = () => {
'user.identity_not_exists': (error) => {
if (parameters.connector) {
navigate(`/social-register/${parameters.connector}`, {
replace: true,
state: {
...(error.data as Record<string, unknown> | undefined),
},
@ -129,8 +130,11 @@ const useSocial = () => {
const { platform, callbackLink } = decodedState;
if (platform === 'web') {
window.location.assign(
new URL(`${location.origin}/sign-in/callback/${connectorId}/${window.location.search}`)
navigate(
new URL(`${location.origin}/sign-in/callback/${connectorId}/${window.location.search}`),
{
replace: true,
}
);
return;
@ -142,7 +146,7 @@ const useSocial = () => {
}
window.location.assign(new URL(`${callbackLink}${window.location.search}`));
}, [parameters.connector, setToast, t]);
}, [navigate, parameters.connector, setToast, t]);
// Social Sign-In Callback Handler
useEffect(() => {