@authid/web-component 1.1.0 → 1.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 +1 -0
- package/authid-web-component.js +8 -0
- package/example.html +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ This integration is the most universal one as it can be used with any frontend t
|
|
|
11
11
|
- `data-url` - required parameter with operation/transaction URL received from authID,
|
|
12
12
|
- `data-target` - force selection of either `mobile` or `desktop` integration variant, `auto` is the default.
|
|
13
13
|
*NOTE: this parameter is obsolete, and it has no effect at the moment.*
|
|
14
|
+
- `data-webauth="true"` - enable automatic handling of Passkey features.
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
package/authid-web-component.js
CHANGED
|
@@ -62,6 +62,14 @@ class AuthIDComponent extends HTMLElement {
|
|
|
62
62
|
shadow.appendChild(container);
|
|
63
63
|
shadow.appendChild(iframe);
|
|
64
64
|
|
|
65
|
+
const dataWebauth = this.getAttribute('data-webauth');
|
|
66
|
+
|
|
67
|
+
if (dataWebauth && dataWebauth !== 'false' && dataWebauth !== 'no') {
|
|
68
|
+
const webauthHandler = document.createElement('script');
|
|
69
|
+
webauthHandler.setAttribute('src', dataUrl.replace('/?', '/webauthhandler.js?'));
|
|
70
|
+
shadow.appendChild(webauthHandler);
|
|
71
|
+
}
|
|
72
|
+
|
|
65
73
|
iframe.addEventListener('load', () => {
|
|
66
74
|
shadow.removeChild(container);
|
|
67
75
|
}, { capture: true, once: true });
|
package/example.html
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
<script src="./authid-web-component.js"></script>
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
|
-
<authid-component data-url="https://id.ipsidy.net/?demo"></authid-component>
|
|
13
|
+
<authid-component data-url="https://id-dev.ipsidy.net/?demo" data-webauth="true"></authid-component>
|
|
14
14
|
</body>
|
|
15
15
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authid/web-component",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "authID integration as a Web Component",
|
|
5
5
|
"main": "authid-web-component.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"author": "authID Team <team@authid.ai>",
|
|
16
16
|
"license": "Apache-2.0",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"eslint": "^8.
|
|
18
|
+
"eslint": "^8.23.1"
|
|
19
19
|
}
|
|
20
20
|
}
|