added if cb url was there in path in after login page

This commit is contained in:
Mamalizz
2025-09-22 15:57:58 +03:30
parent 7c6daa33b9
commit 6e03948d9c
+10 -3
View File
@@ -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 () => {
},
});
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: "مشکلی پیش آمده" });