mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-03 00:33:13 +00:00
Add admin compliance acknowledgement gate
This commit is contained in:
1 parent
c32e29bab0
commit
0acf00c4a1
29 files changed
+1173
-15
No files matched your search
@@ -148,6 +148,23 @@ apiClient.interceptors.response.use(
|
||||
})
|
||||
}
|
||||
|
||||
if (status === 423 && apiData.code === 'ADMIN_COMPLIANCE_ACK_REQUIRED') {
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('admin-compliance-required', {
|
||||
detail: apiData.metadata || {}
|
||||
}))
|
||||
} catch {
|
||||
// ignore event failures
|
||||
}
|
||||
|
||||
return Promise.reject({
|
||||
status,
|
||||
code: apiData.code,
|
||||
message: apiData.message || error.message,
|
||||
metadata: apiData.metadata,
|
||||
})
|
||||
}
|
||||
|
||||
// 401: Try to refresh the token if we have a refresh token
|
||||
// This handles TOKEN_EXPIRED, INVALID_TOKEN, TOKEN_REVOKED, etc.
|
||||
if (status === 401 && !originalRequest._retry) {
|
||||
|
||||
Reference in new issue
Block a user