Update redirect.global

This commit is contained in:
mustafa-rezae 2025-03-29 14:53:00 +03:30
parent 3ee869a66b
commit 1b25bfa2c5
4 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,7 @@
// middleware/redirect.js // middleware/redirect.js
export default defineNuxtRouteMiddleware((to, from) => { export default defineNuxtRouteMiddleware((to, from) => {
if (buildName() == "haditha" && to.path == '/') return navigateTo({ name: "haditha" }); if (buildName() == "haditha" && to.path == "/")
return navigateTo({ name: "haditha" });
else if (buildName() == "haditha" && to.path == "/login")
return navigateTo({ name: "hadithaLogin" });
}); });

View File

@ -51,9 +51,9 @@ export default [
file: "~/systems/hadith_ui/pages/haditha/public-pages/rules.vue", file: "~/systems/hadith_ui/pages/haditha/public-pages/rules.vue",
}, },
// { {
// name: "hadithaLogin", name: "hadithaLogin",
// path: "/haditha/login", path: "/haditha/login",
// file: "~/systems/hadith_ui/pages/haditha/login.vue", file: "~/systems/hadith_ui/pages/haditha/login.vue",
// } }
]; ];

View File

@ -266,6 +266,8 @@ export const useAuthStore = defineStore("authStore", {
// }); // });
}, },
async login(credentials) { async login(credentials) {
console.info(import.meta.env.VITE_AUTH_BASE_URL)
try { try {
const { $api } = useNuxtApp(); const { $api } = useNuxtApp();
const response = await $api(apis.login, { const response = await $api(apis.login, {

@ -1 +1 @@
Subproject commit 3800df1b4005255a315df026e1c7ea9d7f9a71c2 Subproject commit 363d1269f2ff09e8e138d7a8e8aaa773d59913f3