0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(ui): remove social callback page from history (#3002)

This commit is contained in:
simeng-li 2023-01-30 16:15:50 +08:00 committed by GitHub
parent 2e2b153b61
commit fb5d5ed297
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -5,8 +5,11 @@ import { registerWithVerifiedSocial } from '@/apis/interaction';
import useApi from './use-api';
import useRequiredProfileErrorHandler from './use-required-profile-error-handler';
const useSocialRegister = (connectorId?: string) => {
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({ linkSocial: connectorId });
const useSocialRegister = (connectorId?: string, replace?: boolean) => {
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({
linkSocial: connectorId,
replace,
});
const { result: registerResult, run: asyncRegisterWithSocial } = useApi(
registerWithVerifiedSocial,

View file

@ -25,7 +25,7 @@ const useSocialSignInListener = (connectorId?: string) => {
const navigate = useNavigate();
const registerWithSocial = useSocialRegister(connectorId);
const registerWithSocial = useSocialRegister(connectorId, true);
const accountNotExistErrorHandler = useCallback(
async (error: RequestErrorBody) => {
@ -51,7 +51,10 @@ const useSocialSignInListener = (connectorId?: string) => {
[connectorId, navigate, registerWithSocial]
);
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({ flow: UserFlow.signIn });
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({
replace: true,
flow: UserFlow.signIn,
});
const signInWithSocialErrorHandlers: ErrorHandlers = useMemo(
() => ({