🐛 fix(api.tsx): handle null values when calling login function to prevent potential errors

This commit is contained in:
Cristhian Zanforlin Lousa 2023-08-30 19:02:52 -03:00
commit c06cfce385

View file

@ -33,7 +33,7 @@ function ApiInterceptor() {
}
const res = await renewAccessToken(refreshToken);
login(res.data.access_token, res.data.refresh_token);
login(res?.data?.access_token, res?.data?.refresh_token);
try {
if (error?.config?.headers) {
delete error.config.headers["Authorization"];