feat(admin-web/auth): support phone-or-email login and dim shell on expiry
Login form takes a phone-or-email identifier; user info now exposes phone so the shell can fall back through name → phone → email. When membership expires, the app stays on the current route but renders a minimal blocked state in the shell instead of redirecting to a dedicated page; an Axios interceptor flips the local session into the blocked state when the API returns trial/subscription errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ const router = createRouter({
|
||||
{
|
||||
path: "/membership-blocked",
|
||||
name: "membership-blocked",
|
||||
component: () => import("@/views/MembershipBlockedView.vue"),
|
||||
redirect: "/workspace",
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
@@ -261,22 +261,11 @@ router.beforeEach(async (to) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (authStore.isAuthenticated && authStore.isMembershipBlocked && to.name !== "membership-blocked") {
|
||||
return { name: "membership-blocked" };
|
||||
}
|
||||
|
||||
if (to.name === "membership-blocked" && authStore.isAuthenticated && !authStore.isMembershipBlocked) {
|
||||
return { name: "workspace" };
|
||||
}
|
||||
|
||||
if (to.meta.requiresKol && !authStore.isActiveKol) {
|
||||
return { name: "workspace" };
|
||||
}
|
||||
|
||||
if (to.name === "login" && authStore.isAuthenticated) {
|
||||
if (authStore.isMembershipBlocked) {
|
||||
return { name: "membership-blocked" };
|
||||
}
|
||||
return { name: "workspace" };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user