Skip to content

Commit 70f0fa3

Browse files
committed
js: use import map
1 parent b9b7e56 commit 70f0fa3

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

mfa/static/mfa/fido2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as webauthnJSON from 'https://cdn.jsdelivr.net/npm/@github/webauthn-json@2.1.1/dist/esm/webauthn-json.browser-ponyfill.js';
1+
import * as webauthnJSON from 'webauthn-json';
22

33
var initCreate = function() {
44
var form = document.querySelector('form[data-fido2-create]');

mfa/templates/mfa/auth_FIDO2.html

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ <h1>Two-factor authentication</h1>
1414
<a href="{% url 'mfa:auth' 'recovery' %}">Use recovery code instead</a>
1515
</form>
1616

17+
<script type="importmap">{"imports": {"webauthn-json": "https://cdn.jsdelivr.net/npm/@github/[email protected]/dist/esm/webauthn-json.browser-ponyfill.js"}}</script>
1718
<script src="{% static 'mfa/fido2.js' %}" type="module"></script>

mfa/templates/mfa/create_FIDO2.html

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
<button>Create</button>
1616
</form>
1717

18+
<script type="importmap">{"imports": {"webauthn-json": "https://cdn.jsdelivr.net/npm/@github/[email protected]/dist/esm/webauthn-json.browser-ponyfill.js"}}</script>
1819
<script src="{% static 'mfa/fido2.js' %}" type="module"></script>

0 commit comments

Comments
 (0)