@autobusal/providers 1.30.0 → 1.30.1

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.30.1
4
+
5
+ ### Fixed
6
+
7
+ - **Only the documents 403 redirects to the documents page.** This fired on
8
+ every 403 there is. The intent is sound - an account blocked by an unsigned
9
+ document should be taken to the screen that unblocks it - but the other
10
+ source of a 403 in this API is the email-verification gate, and sending
11
+ somebody there for that told them nothing and fixed nothing. It read as a
12
+ deliberate product redirect and was this line. Keyed on a `reason` the
13
+ server sets rather than the message, which is translated fifteen ways, and
14
+ guarded against redirecting the documents page to itself.
15
+
3
16
  ## 1.30.0
4
17
 
5
18
  ### Added
@@ -88,8 +88,31 @@ apiClient.interceptors.response.use(response => (
88
88
  return Promise.reject(error);
89
89
  }
90
90
 
91
- // if the user is not valid
92
- if (error.response.status === 403) {
91
+ /*
92
+ * Edited: Ferjolt Ozuni - Date: 2026-08-07
93
+ *
94
+ * Only the DOCUMENTS 403 goes to the documents page.
95
+ *
96
+ * This used to fire on every 403 there is. The intent is sound - an
97
+ * account blocked by an unsigned document should be taken to the one
98
+ * screen that unblocks it - but the other source of a 403 in this API is
99
+ * the email-verification gate, and sending somebody there for that told
100
+ * them nothing and fixed nothing. It read as a deliberate product
101
+ * redirect; it was this line.
102
+ *
103
+ * Keyed on a `reason` the server sets (Middleware\ValidUser), not on the
104
+ * message: that text is translated into fifteen languages, so comparing
105
+ * it would work in one.
106
+ *
107
+ * The pathname guard matters as much as the reason. Without it, a 403
108
+ * raised BY the documents page redirects the documents page to itself,
109
+ * which is a reload loop rather than a fix.
110
+ */
111
+ if (
112
+ error.response.status === 403
113
+ && error.response.data?.reason === 'documents'
114
+ && window.location.pathname !== '/account/documents'
115
+ ) {
93
116
  window.location.href = '/account/documents';
94
117
  }
95
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.30.0",
3
+ "version": "1.30.1",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"