@autobusal/providers 1.40.2 → 1.40.4
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.
- package/CHANGELOG.md +12 -0
- package/Queries/apiClient.ts +33 -3
- package/package.json +1 -1
- package/types/orders.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.40.4
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **The Content-Language header survives a cold load** - requests firing before i18next.init resolved carried no language at all, which is the recurring English-menu-under-/sq leak (CMS-05/CMS-07). The interceptor now falls back to the URL's locale prefix, then the stored preference.
|
|
8
|
+
|
|
9
|
+
## 1.40.3
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **An expired session interrupted on a private page carries that page through the logout hop** (`/account/logout?return=...`), so signing back in can resume there. (Audit ADM-08a.)
|
|
14
|
+
|
|
3
15
|
## 1.40.2
|
|
4
16
|
|
|
5
17
|
### Fixed
|
package/Queries/apiClient.ts
CHANGED
|
@@ -49,8 +49,25 @@ if (!isBffMode) {
|
|
|
49
49
|
// upstream (see @autobusal/bff) - both sides had to change, only one of
|
|
50
50
|
// them silently doing nothing would look identical to neither working.
|
|
51
51
|
apiClient.interceptors.request.use(config => {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
/*
|
|
53
|
+
* Claude - 2026-08-22 (audit findings CMS-05/CMS-07): on a COLD load,
|
|
54
|
+
* requests that fire before i18next.init resolves saw no language at
|
|
55
|
+
* all - so the first menu/settings fetch of a /sq visit carried no
|
|
56
|
+
* header and came back English, which is exactly the recurring
|
|
57
|
+
* English-menu-under-/sq leak the audit kept meeting. The fallback
|
|
58
|
+
* resolves the same way Setup/languages does: the URL's locale prefix
|
|
59
|
+
* first, then the stored preference. An unknown two-letter first
|
|
60
|
+
* segment is harmless - the API ignores languages it doesn't serve.
|
|
61
|
+
*/
|
|
62
|
+
const fromUrl = window.location.pathname.split('/')[1];
|
|
63
|
+
|
|
64
|
+
const language = i18next.language
|
|
65
|
+
|| (/^[a-z]{2}$/.test(fromUrl) ? fromUrl : '')
|
|
66
|
+
|| localStorage.getItem('language')
|
|
67
|
+
|| '';
|
|
68
|
+
|
|
69
|
+
if (language) {
|
|
70
|
+
config.headers['Content-Language'] = language;
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
return config;
|
|
@@ -112,7 +129,20 @@ apiClient.interceptors.response.use(response => (
|
|
|
112
129
|
}
|
|
113
130
|
}
|
|
114
131
|
|
|
115
|
-
|
|
132
|
+
/*
|
|
133
|
+
* Claude - 2026-08-22 (audit finding ADM-08a): when the dead session
|
|
134
|
+
* was interrupted on a private page, carry that page through the
|
|
135
|
+
* logout hop - Logout hands it to the login screen, and a successful
|
|
136
|
+
* sign-in lands back where the bookmark pointed instead of on the
|
|
137
|
+
* storefront with no explanation.
|
|
138
|
+
*/
|
|
139
|
+
const here = window.location.pathname;
|
|
140
|
+
|
|
141
|
+
const isPrivate = ['/admin', '/account', '/operator'].some(prefix => here.startsWith(prefix));
|
|
142
|
+
|
|
143
|
+
window.location.href = isPrivate
|
|
144
|
+
? '/account/logout?return=' + encodeURIComponent(here + window.location.search)
|
|
145
|
+
: '/account/logout';
|
|
116
146
|
|
|
117
147
|
return Promise.reject(error);
|
|
118
148
|
}
|
package/package.json
CHANGED
package/types/orders.ts
CHANGED
|
@@ -42,6 +42,10 @@ export interface OrderData {
|
|
|
42
42
|
note_cancel: string
|
|
43
43
|
actions: string[]
|
|
44
44
|
created_at: string
|
|
45
|
+
// Claude - 2026-08-22 (audit TK-01): the PNR-style reference support and
|
|
46
|
+
// operators quote - both the listing and the single-order endpoint carry
|
|
47
|
+
// it; optional only because older cached rows may predate the column.
|
|
48
|
+
order_number?: string
|
|
45
49
|
/*
|
|
46
50
|
* Edited: Ferjolt Ozuni - Date: 2026-08-11
|
|
47
51
|
* Who owns this order, collapsed to what a viewer outside the account
|