feat: account created page redirect button added, navigate logic created, refresh token bug fix

This commit is contained in:
مهرزاد قدرتی
2025-08-19 16:46:58 +03:30
parent c8ffd34f15
commit 6ff25c69f2
12 changed files with 430 additions and 36 deletions

View File

@@ -49,27 +49,31 @@ export const AuthenticationSteps = (): JSX.Element => {
}
};
const handleUserLoggedIn = (userId: GUID) => {
localStorage.setItem('userID', userId);
const handleUserLoggedIn = () => {
redirectToReturnUrl();
};
const handleConfrimPhoneNumber = (userId: GUID) => {
localStorage.setItem('userID', userId);
const handleConfrimPhoneNumber = () => {
setCurrentStep('addPhoneNumber');
};
const handlePhoneNumberVerified = () => {
navigate('/signup');
if (authReturnUrl) {
navigate(`/signup?returnUrl=${authReturnUrl}`);
} else {
navigate(`/signup`);
}
};
const redirectToReturnUrl = () => {
if (!authReturnUrl) {
navigate(import.meta.env.VITE_DEFUALT_AUTH_RETURN_URL);
} else {
location.href = authReturnUrl;
if (authMode === 'register') {
navigate(`/account-created?returnUrl=${authReturnUrl}`);
} else {
location.href = authReturnUrl;
}
}
};