mirror of
https://github.com/logto-io/logto.git
synced 2025-01-13 21:30:30 -05:00
fix(ui): remove social callback page from history (#3002)
This commit is contained in:
parent
2e2b153b61
commit
fb5d5ed297
2 changed files with 10 additions and 4 deletions
|
@ -5,8 +5,11 @@ import { registerWithVerifiedSocial } from '@/apis/interaction';
|
||||||
import useApi from './use-api';
|
import useApi from './use-api';
|
||||||
import useRequiredProfileErrorHandler from './use-required-profile-error-handler';
|
import useRequiredProfileErrorHandler from './use-required-profile-error-handler';
|
||||||
|
|
||||||
const useSocialRegister = (connectorId?: string) => {
|
const useSocialRegister = (connectorId?: string, replace?: boolean) => {
|
||||||
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({ linkSocial: connectorId });
|
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({
|
||||||
|
linkSocial: connectorId,
|
||||||
|
replace,
|
||||||
|
});
|
||||||
|
|
||||||
const { result: registerResult, run: asyncRegisterWithSocial } = useApi(
|
const { result: registerResult, run: asyncRegisterWithSocial } = useApi(
|
||||||
registerWithVerifiedSocial,
|
registerWithVerifiedSocial,
|
||||||
|
|
|
@ -25,7 +25,7 @@ const useSocialSignInListener = (connectorId?: string) => {
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const registerWithSocial = useSocialRegister(connectorId);
|
const registerWithSocial = useSocialRegister(connectorId, true);
|
||||||
|
|
||||||
const accountNotExistErrorHandler = useCallback(
|
const accountNotExistErrorHandler = useCallback(
|
||||||
async (error: RequestErrorBody) => {
|
async (error: RequestErrorBody) => {
|
||||||
|
@ -51,7 +51,10 @@ const useSocialSignInListener = (connectorId?: string) => {
|
||||||
[connectorId, navigate, registerWithSocial]
|
[connectorId, navigate, registerWithSocial]
|
||||||
);
|
);
|
||||||
|
|
||||||
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({ flow: UserFlow.signIn });
|
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler({
|
||||||
|
replace: true,
|
||||||
|
flow: UserFlow.signIn,
|
||||||
|
});
|
||||||
|
|
||||||
const signInWithSocialErrorHandlers: ErrorHandlers = useMemo(
|
const signInWithSocialErrorHandlers: ErrorHandlers = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
|
Loading…
Add table
Reference in a new issue