Skip to content

Commit

Permalink
- upgraded msal packages (#10)
Browse files Browse the repository at this point in the history
- added catch failover for acquireTokenSilent to acquireTokenRedirect
- switched AvlHistory images to lower case
  • Loading branch information
reed-tom authored Sep 27, 2021
1 parent e6bbe2f commit 1db7128
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ yarn-error.log*
deploy/*
debug.log
/src/sidebar/components/toc/debug.log
*.zip
*.zip
package-lock.json
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@azure/msal-browser": "^2.14.0",
"@azure/msal-react": "^1.0.0-beta.1",
"@azure/msal-browser": "^2.17.0",
"@azure/msal-react": "^1.0.2",
"array-move": "^2.2.2",
"create-react-class": "^15.7.0",
"eslint-utils": "^1.4.3",
Expand Down
41 changes: 40 additions & 1 deletion src/helpers/helpersSecured.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ export function getJSONSecured(url, callback) {
.catch((error) => {
console.log("Error - " + url);
console.log(error);
callback("error");
console.error(error);
});
})
.catch((error) => {
window.instance
.acquireTokenRedirect({
account: window.account,
})
.catch((error) => {
console.log("Error - " + url);
console.error(error);
});
});
Expand Down Expand Up @@ -140,6 +149,16 @@ export function getJSONSecuredNoCors(url, callback) {
callback("error");
console.error(error);
});
})
.catch((error) => {
window.instance
.acquireTokenRedirect({
account: window.account,
})
.catch((error) => {
console.log("Error - " + url);
console.error(error);
});
});
}

Expand Down Expand Up @@ -175,6 +194,16 @@ export function postJSONSecured(url, data = {}, callback) {
callback("error");
console.error(error);
});
})
.catch((error) => {
window.instance
.acquireTokenRedirect({
account: window.account,
})
.catch((error) => {
console.log("Error - " + url);
console.error(error);
});
});
}

Expand Down Expand Up @@ -217,6 +246,16 @@ export function postJSONSecuredDownloadFile(url, data = {}, fileName, callback)
callback("error");
console.error(error);
});
})
.catch((error) => {
window.instance
.acquireTokenRedirect({
account: window.account,
})
.catch((error) => {
console.log("Error - " + url);
console.error(error);
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/components/themes/avl/AvlHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ export default AvlHistory;
const images = importAllImages(require.context("./images", false, /\.(png|jpe?g|svg|gif)$/));
function importAllImages(r) {
let images = {};
r.keys().map((item, index) => (images[item.replace("./", "")] = r(item)));
r.keys().map((item, index) => (images[item.replace("./", "").toLowerCase()] = r(item)));
return images;
}

Expand Down

0 comments on commit 1db7128

Please sign in to comment.