cidaas-javascript-sdk 2.2.6 → 2.2.7
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.
- package/CHANGELOG.md +2 -3
- package/package.json +1 -1
- package/src/main/web-auth/webauth.js +21 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
## [2.2.
|
|
1
|
+
## [2.2.7](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.2.6...v2.2.7) (2023-02-06)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* added
|
|
7
|
-
* added fingerprintjs ([9be8b76](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/9be8b76b45d1ceee33ba9eca74c3acd2899a3be3))
|
|
6
|
+
* **[gitlab-240](https://gitlab.widas.de/cidaas-v2/auth/issues/-/issues/240):** added cookie for device_dr ([bb50022](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/bb5002253e36fdccd1052bba746e2efbcd031a07))
|
package/package.json
CHANGED
|
@@ -1942,28 +1942,30 @@ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
|
|
|
1942
1942
|
WebAuth.prototype.getDeviceInfo = function () {
|
|
1943
1943
|
return new Promise(function (resolve, reject) {
|
|
1944
1944
|
try {
|
|
1945
|
+
const value = ('; '+document.cookie).split(`; cidaas_dr=`).pop().split(';')[0];
|
|
1945
1946
|
const fpPromise = fingerprint.load();
|
|
1946
1947
|
var options = {fingerprint:"", userAgent:""};
|
|
1947
|
-
(
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1948
|
+
if(!value) {
|
|
1949
|
+
(async () => {
|
|
1950
|
+
const fp = await fpPromise;
|
|
1951
|
+
const result = await fp.get();
|
|
1952
|
+
options.fingerprint = result.visitorId
|
|
1953
|
+
options.userAgent = window.navigator.userAgent
|
|
1954
|
+
var http = new XMLHttpRequest();
|
|
1955
|
+
var _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
|
|
1956
|
+
http.onreadystatechange = function () {
|
|
1957
|
+
if (http.readyState == 4) {
|
|
1958
|
+
resolve(JSON.parse(http.responseText));
|
|
1959
|
+
}
|
|
1960
|
+
};
|
|
1961
|
+
http.open("POST", _serviceURL, true);
|
|
1962
|
+
http.setRequestHeader("Content-type", "application/json");
|
|
1963
|
+
if (window.localeSettings) {
|
|
1964
|
+
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1957
1965
|
}
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
if (window.localeSettings) {
|
|
1962
|
-
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1963
|
-
}
|
|
1964
|
-
http.send(JSON.stringify(options));
|
|
1965
|
-
})();
|
|
1966
|
-
|
|
1966
|
+
http.send(JSON.stringify(options));
|
|
1967
|
+
})();
|
|
1968
|
+
}
|
|
1967
1969
|
} catch (ex) {
|
|
1968
1970
|
reject(ex);
|
|
1969
1971
|
}
|