casdoor 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/oauth.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "casdoor",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "The Casdoor extension can help browser users automatically log into applications protected by Casdoor single-sign-on (SSO) system.",
5
5
  "scripts": {
6
6
  "semantic-release": "semantic-release"
package/src/oauth.js CHANGED
@@ -119,9 +119,11 @@ let accessToken;
119
119
  let applicationName;
120
120
 
121
121
  function getDomAccessToken() {
122
- if(window.location.pathname != "/src/popup.html"){
123
- accessToken = document.getElementById("CasdoorAccessToken").getAttribute("value");
124
- applicationName = document.getElementById("CasdoorApplicationName").getAttribute("value");
122
+ const accessTokenDom = document.getElementById("CasdoorAccessToken")
123
+ const applicationNameDom = document.getElementById("CasdoorApplicationName")
124
+ if(window.location.pathname != "/src/popup.html" && accessTokenDom && applicationNameDom){
125
+ accessToken = accessTokenDom.getAttribute("value");
126
+ applicationName = applicationNameDom.getAttribute("value");
125
127
  if (accessToken && applicationName) {
126
128
  sdk.getUserProfile(accessToken).then((userProfile) => {
127
129
  userProfile.applicationName = applicationName;