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:
@@ -160,7 +160,16 @@ export const useAuthStore = defineStore("auth", () => {
|
||||
|
||||
const isAuthenticated = computed(() => Boolean(accessToken.value && user.value));
|
||||
const membership = computed(() => user.value?.membership ?? null);
|
||||
const isMembershipBlocked = computed(() => Boolean(membership.value?.blocked));
|
||||
const isMembershipBlocked = computed(() => {
|
||||
const value = membership.value;
|
||||
return Boolean(
|
||||
value?.blocked ||
|
||||
value?.status === "expired" ||
|
||||
value?.blocked_reason === "trial_plan_expired" ||
|
||||
value?.blocked_reason === "subscription_required" ||
|
||||
value?.blocked_reason === "subscription_inactive",
|
||||
);
|
||||
});
|
||||
const kolProfile = computed(() => user.value?.kol_profile ?? null);
|
||||
const isActiveKol = computed(() => kolProfile.value?.status === "active");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user