From 6e03948d9cdcc634b1aa3ad4347b31ce734e61e1 Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Mon, 22 Sep 2025 15:57:58 +0330 Subject: [PATCH] added if cb url was there in path in after login page --- frontend/pages/signin.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/pages/signin.vue b/frontend/pages/signin.vue index d48f394..8916a22 100644 --- a/frontend/pages/signin.vue +++ b/frontend/pages/signin.vue @@ -24,12 +24,16 @@ definePageMeta({ middleware: ["check-is-not-logged-in"], }); -// state +// seo useSeoMeta({ - title : "ورود به فروشگاه" + title: "ورود به فروشگاه", }); +// state + +const route = useRoute(); + const { addToast } = useToast(); const { updateToken, updateRefreshToken } = useAuth(); @@ -110,7 +114,6 @@ const handleLogin = async () => { updateToken(response.access); updateRefreshToken(response.refresh); - await new Promise((resolve) => setTimeout(resolve, 1000)); await refetchAccount(); addToast({ @@ -120,7 +123,11 @@ const handleLogin = async () => { }, }); - window.location.href = "/"; + if (route.query.hasOwnProperty("cb_url")) { + window.location.href = route.query["cb_url"] as string; + } else { + window.location.href = "/"; + } } catch (e) { otpCode.value = []; addToast({ message: "مشکلی پیش آمده" });