cidaas-javascript-sdk 2.1.2 → 2.2.0
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/README.md
CHANGED
|
@@ -770,7 +770,8 @@ This method takes an object as input.
|
|
|
770
770
|
options = {
|
|
771
771
|
sub: "7e4f79a9-cfbc-456d-936a-e6bc1de2d4b9",
|
|
772
772
|
requestId: "7d86460b-8288-4341-aed1- 10dd27a4565c",
|
|
773
|
-
accept-language: "en"
|
|
773
|
+
accept-language: "en",
|
|
774
|
+
access_token: "your_access_token"
|
|
774
775
|
}
|
|
775
776
|
```
|
|
776
777
|
|
package/package.json
CHANGED
|
@@ -1761,7 +1761,7 @@ WebAuth.prototype.initiateVerification = function (options) {
|
|
|
1761
1761
|
// deleteUserAccount
|
|
1762
1762
|
WebAuth.prototype.deleteUserAccount = function (options) {
|
|
1763
1763
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/unregister/scheduler/schedule/" + options.sub;
|
|
1764
|
-
return createPostPromise(options, _serviceURL, undefined);
|
|
1764
|
+
return createPostPromise(options, _serviceURL, undefined, options.access_token);
|
|
1765
1765
|
};
|
|
1766
1766
|
|
|
1767
1767
|
// getMissingFieldsLogin
|
|
@@ -1845,6 +1845,28 @@ WebAuth.prototype.loginAfterRegister = function (options) {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
};
|
|
1847
1847
|
|
|
1848
|
+
// device code flow - verify
|
|
1849
|
+
WebAuth.prototype.deviceCodeVerify = function (code) {
|
|
1850
|
+
const params = `user_code=${encodeURI(code)}`;
|
|
1851
|
+
const url = `${window.webAuthSettings.authority}/token-srv/device/verify?${params}`;
|
|
1852
|
+
try {
|
|
1853
|
+
const form = document.createElement('form');
|
|
1854
|
+
form.action = url
|
|
1855
|
+
form.method = 'GET';
|
|
1856
|
+
const hiddenField = document.createElement("input");
|
|
1857
|
+
hiddenField.setAttribute("type", "hidden");
|
|
1858
|
+
hiddenField.setAttribute("name", 'user_code');
|
|
1859
|
+
hiddenField.setAttribute("value", encodeURI(code));
|
|
1860
|
+
|
|
1861
|
+
form.appendChild(hiddenField);
|
|
1862
|
+
document.body.appendChild(form);
|
|
1863
|
+
form.submit();
|
|
1864
|
+
} catch (ex) {
|
|
1865
|
+
throw new Error(ex);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
|
|
1848
1870
|
WebAuth.prototype.userCheckExists = function (options) {
|
|
1849
1871
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/checkexists/" + options.requestId;
|
|
1850
1872
|
return createPostPromise(options, _serviceURL, undefined);
|
|
@@ -1854,4 +1876,4 @@ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
|
|
|
1854
1876
|
window.localeSettings = acceptLanguage;
|
|
1855
1877
|
}
|
|
1856
1878
|
|
|
1857
|
-
module.exports = WebAuth;
|
|
1879
|
+
module.exports = WebAuth;
|
|
@@ -131,6 +131,7 @@ declare class WebAuth {
|
|
|
131
131
|
getMissingFieldsLogin(trackId: any): Promise<any>;
|
|
132
132
|
progressiveRegistration(options: any, headers: any): Promise<any>;
|
|
133
133
|
loginAfterRegister(options: any): void;
|
|
134
|
+
deviceCodeVerify(code: any): void;
|
|
134
135
|
userCheckExists(options: any): Promise<any>;
|
|
135
136
|
setAcceptLanguageHeader(acceptLanguage: any): void;
|
|
136
137
|
}
|