@mundogamernetwork/shared-ui 1.16.7 → 1.16.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,10 @@ onUnmounted(() => {
48
48
  });
49
49
 
50
50
  const handleLogout = async () => {
51
- await performLogout(`${accountsBaseUrl}/login`);
51
+ // No explicit redirect — performLogout defaults to the current page,
52
+ // so logging out keeps you on this site (now as a guest) instead of
53
+ // bouncing to accounts' login page. See useLogout.ts.
54
+ await performLogout();
52
55
  };
53
56
 
54
57
  const handleToggleOnline = () => {
@@ -130,6 +133,15 @@ const handleToggleOnline = () => {
130
133
  </div>
131
134
  </div>
132
135
 
136
+ <!--
137
+ Optional, empty by default — a host with a user-type/role concept
138
+ (jobs-frontend's "Employer"/plan tier, formerly rendered by its own
139
+ now-deleted local HeaderUIUser fork) fills this via
140
+ <template #user-subtitle>; hosts without one render nothing here,
141
+ same as today.
142
+ -->
143
+ <slot name="user-subtitle" />
144
+
133
145
  <div v-if="features.wallet && user?.coins !== null" class="row info-row">
134
146
  <span class="coins">
135
147
  <MGIcon icon="coin-v2" />
@@ -23,7 +23,13 @@ export function useLogout() {
23
23
  });
24
24
  }
25
25
 
26
- const target = redirectTo || `${accountsBaseUrl}/login`;
26
+ // Default: stay on the current site, now as a guest — these are mostly
27
+ // publicly-browsable content sites (a job posting, a video, a post),
28
+ // so bouncing to a different domain's login page on every logout is
29
+ // disorienting. accountsBaseUrl/login is still available for a caller
30
+ // that genuinely needs it (e.g. accounts' own logout), just not the
31
+ // default anymore.
32
+ const target = redirectTo || (typeof window !== "undefined" ? window.location.href : `${accountsBaseUrl}/login`);
27
33
 
28
34
  if (typeof document === "undefined" || !apiBase) {
29
35
  if (typeof window !== "undefined") window.location.href = target;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mundogamernetwork/shared-ui",
3
- "version": "1.16.7",
3
+ "version": "1.16.9",
4
4
  "description": "Mundo Gamer Network - Shared UI Layer (Nuxt 3)",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
package/pages/faq.vue CHANGED
@@ -8,6 +8,36 @@ const { isFaqOpened, faq } = storeToRefs(institutionalStore);
8
8
 
9
9
  const searchTerm = ref("");
10
10
 
11
+ // Same host-agnostic login-redirect construction as MgLoginRegisterMenu's
12
+ // goLogin() — routes through the CURRENT platform's own /login (apiBaseURL
13
+ // host) rather than accountsBaseUrl/login directly, since most platforms'
14
+ // session cookie is scoped to their own API domain, not accounts'. Inlined
15
+ // rather than imported for the same reason as MgLoginRegisterMenu: this
16
+ // file ships as raw TS/Vue inside an npm package, and relative .ts imports
17
+ // from node_modules fail in Vite production builds.
18
+ const runtimeConfig = useRuntimeConfig();
19
+ const apiBase = (
20
+ (runtimeConfig.public.mgSharedUi?.apiBaseURL as string) ||
21
+ (runtimeConfig.public.apiBaseURL as string) ||
22
+ (import.meta.env.VITE_API_BASE_URL as string) ||
23
+ ""
24
+ ).replace(/\/api\/v1\/?$/, "");
25
+ const accountsBaseUrl =
26
+ (runtimeConfig.public.mgSharedUi?.accountsBaseUrl as string) ||
27
+ (runtimeConfig.public.accountsBaseUrl as string) ||
28
+ (import.meta.env.VITE_BASE_ACCOUNTS_URL as string) ||
29
+ "";
30
+ const systemId =
31
+ (runtimeConfig.public.mgSharedUi?.systemId as string) ||
32
+ (runtimeConfig.public.platformId as string) ||
33
+ (import.meta.env.VITE_SYSTEM_ID as string) ||
34
+ "";
35
+ const openTicketUrl = (() => {
36
+ const params: Record<string, string> = { redirect_to: `${accountsBaseUrl}/account/support/new` };
37
+ if (systemId) params.system_id = systemId;
38
+ return `${apiBase}/login?${new URLSearchParams(params)}`;
39
+ })();
40
+
11
41
  const showModal = ref(false);
12
42
  const modalMessage = ref("");
13
43
  const closeModal = () => {
@@ -16,8 +46,6 @@ const closeModal = () => {
16
46
 
17
47
  async function fetchFaqs() {
18
48
  try {
19
- const config = useRuntimeConfig();
20
- const systemId = config.public.mgSharedUi?.systemId || import.meta.env.VITE_SYSTEM_ID;
21
49
  await institutionalStore.fetchFaq({
22
50
  filter: {
23
51
  term: searchTerm.value,
@@ -102,6 +130,9 @@ function toggleFaq(index: number) {
102
130
  </span>
103
131
  </div>
104
132
  </div>
133
+ <a :href="openTicketUrl" class="press__button">
134
+ <span class="press__button--text">{{ $t("more.faq.open_ticket_btn") }}</span>
135
+ </a>
105
136
  </div>
106
137
  </div>
107
138
  </div>
@@ -271,6 +302,26 @@ function toggleFaq(index: number) {
271
302
  }
272
303
  }
273
304
  }
305
+
306
+ &__button {
307
+ background: var(--chip-text);
308
+ display: flex;
309
+ width: 200px;
310
+ height: 32px;
311
+ padding: 0px 12px 0px 8px;
312
+ justify-content: center;
313
+ align-items: center;
314
+ gap: 4px;
315
+ margin-top: 16px;
316
+
317
+ &--text {
318
+ color: var(--chip-background-2);
319
+ text-align: center;
320
+ font-size: 12px;
321
+ font-weight: 400;
322
+ line-height: 16px;
323
+ }
324
+ }
274
325
  }
275
326
  }
276
327