redirect url

This commit is contained in:
hamid zarghami
2025-04-21 11:50:49 +03:30
parent 6badc5fb31
commit 1e134c1e19
7 changed files with 48 additions and 23 deletions
+6
View File
@@ -15,6 +15,7 @@ import { toast } from 'react-toastify'
import { ErrorType } from '../../../helpers/types'
import { setRefreshToken } from '../../../config/func'
import { setToken } from '../../../config/func'
import { getRedirectUrl } from '../../../config/func'
const LoginStep3: FC = () => {
@@ -37,6 +38,11 @@ const LoginStep3: FC = () => {
onSuccess(data) {
setToken(data?.data?.accessToken?.token)
setRefreshToken(data?.data?.refreshToken?.token)
const redirectUrl = getRedirectUrl();
if (redirectUrl) {
window.location.href = redirectUrl;
return; // Prevent the default navigation
}
window.location.href = Pages.dashboard
},
onError(error: ErrorType) {