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:
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 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,
|
||||
|
|
|
@ -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(
|
||||
() => ({
|
||||
|
|
Loading…
Reference in a new issue