@autobusal/providers 1.43.3 → 1.43.5

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.
@@ -19,9 +19,29 @@ import { UserData } from '../types/users';
19
19
  // runs when there's an actual signal of a prior login: the bearer token
20
20
  // (bearer mode) or the redacted user stub this same store persists (bff
21
21
  // mode, where the token itself is an httpOnly cookie invisible to JS).
22
- const hasLoginSignal = (): boolean => (
22
+ /*
23
+ * Claude - 2026-09-07: the BFF's readable marker, set by /bff/handoff and
24
+ * cleared by /bff/logout (@autobusal/bff 1.7.2).
25
+ *
26
+ * A handoff is the one way into a BFF session that writes NO stub: the
27
+ * browser lands on an origin it has never signed in on - that is what a
28
+ * handoff is for - so localStorage is empty by construction, and this hook
29
+ * stayed disabled. Measured on a clean browser: /bff/session said
30
+ * authenticated and the SPA still sent the visitor to the login form. The
31
+ * marker carries no secret; it is the one bit that makes this hook ask.
32
+ */
33
+ const hasBffSignal = (): boolean => {
34
+ try {
35
+ return typeof document !== 'undefined' && /(?:^|;\s*)bff_signal=1(?:;|$)/.test(document.cookie);
36
+ } catch {
37
+ return false;
38
+ }
39
+ };
40
+
41
+ export const hasLoginSignal = (): boolean => (
23
42
  (!isBffMode && localStorage.getItem('token') !== null)
24
43
  || localStorage.getItem('user') !== null
44
+ || (isBffMode && hasBffSignal())
25
45
  );
26
46
 
27
47
  const useUserBootstrap = (): void => {
package/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import Providers from './Providers';
2
2
  import apiClient, { isBffMode } from './Queries/apiClient';
3
3
  import { storedReferral } from './Setup/useReferralTouch';
4
+ import { hasLoginSignal } from './Setup/useUserBootstrap';
4
5
  import ErrorBoundary from './Errors/ErrorBoundary';
5
6
  import Message from './Errors/Message';
6
7
  import useMenuStore from './stores/menu';
@@ -15,6 +16,7 @@ export {
15
16
  Message,
16
17
  useMenuStore,
17
18
  useUserStore,
19
+ hasLoginSignal,
18
20
  registerStaleChunkRecovery
19
21
  };
20
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.43.3",
3
+ "version": "1.43.5",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts",
package/types/settings.ts CHANGED
@@ -482,6 +482,7 @@ export interface LabelPayments {
482
482
  mollie: boolean
483
483
  raiffeisen: boolean
484
484
  nexi: boolean
485
+ mgpay?: boolean
485
486
  }
486
487
 
487
488
  // Edited: Ferjolt Ozuni - Date: 2026-07-18
@@ -541,6 +542,19 @@ export interface LabelPayments {
541
542
  nexi: GatewayCredentials<{
542
543
  api_key: string
543
544
  }> & {
545
+ /*
546
+ * Claude - 2026-09-07: the Magus Pay Hub. A site id and secret per mode
547
+ * (issued by the hub's site:create); `url` is optional and points a
548
+ * development label at a hub on another host.
549
+ */
550
+ mgpay?: GatewayCredentials<{
551
+ site_id: string
552
+ secret: string
553
+ url?: string
554
+ }> & {
555
+ surcharge?: number
556
+ currency?: string
557
+ }
544
558
  // see the note on raiffeisen.currency above
545
559
  currency: string
546
560
  }
package/types/users.ts CHANGED
@@ -66,6 +66,7 @@ export interface ApiData {
66
66
  mollie: number
67
67
  raiffeisen: number
68
68
  nexi: number
69
+ mgpay?: number
69
70
  }
70
71
 
71
72
  export interface SubscribedData {