Skip to content

Commit

Permalink
Add optional chaining to resolve null error (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellemaxwell authored Jan 18, 2024
1 parent 01eb917 commit 2289c0e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion web/gds-user-ui/src/utils/auth0.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const auth0Hash = (hash?: any) => {
if (err) {
reject(err);
} else {
const decodeToken: any = jwt_decode(authResult.accessToken);
const decodeToken: any = jwt_decode(authResult?.accessToken);
authResult.idTokenPayload.permissions = decodeToken.permissions;

resolve(authResult);
Expand Down
1 change: 0 additions & 1 deletion web/gds-user-ui/src/utils/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ axiosInstance.interceptors.response.use(
axiosInstance.defaults.headers.common.Authorization = `Bearer ${token}`;
axiosInstance.defaults.headers.common['X-CSRF-Token'] = csrfToken;
originalRequest._retry += 1;
console.log('retrying request', originalRequest);
return axiosInstance(originalRequest);
}
} else {
Expand Down

0 comments on commit 2289c0e

Please sign in to comment.