feat: Implement Two-Factor Authentication (2FA) with new OTP and login forms, updated API endpoints, and manager functionality to disable 2FA.
This commit is contained in:
@@ -159,17 +159,21 @@ export const handleRequestConfig: RequestConfig = {
|
||||
);
|
||||
}
|
||||
|
||||
// Rebuild request options from config
|
||||
const originalConfig = response.config;
|
||||
const newOptions = {
|
||||
...options,
|
||||
method: originalConfig.method,
|
||||
headers: {
|
||||
...(options.headers || {}),
|
||||
...(originalConfig.headers || {}),
|
||||
Authorization: `${newToken}`,
|
||||
},
|
||||
data: originalConfig.data,
|
||||
params: originalConfig.params,
|
||||
skipAuthRefresh: true,
|
||||
};
|
||||
|
||||
// Gọi lại request gốc với accessToken mới
|
||||
return request(response.url, newOptions);
|
||||
return request(originalConfig.url, newOptions);
|
||||
}
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user