fix: webauthn support check (#2450)

This commit is contained in:
Livio Amstutz 2021-10-02 12:26:03 +02:00 committed by GitHub
parent b71413fa6c
commit 415d0c7ab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,7 @@
function checkWebauthnSupported(button, func) {
let support = document.getElementsByClassName("wa-support");
let noSupport = document.getElementsByClassName("wa-no-support");
if (typeof (PublicKeyCredential) === undefined) {
if (!window.PublicKeyCredential) {
for (let item of noSupport) {
item.classList.remove('hidden');
}

View File

@ -18,7 +18,7 @@
<div class="fields">
<p class="wa-no-support lgn-error hidden">{{t "InitMFAU2F.NotSupported"}}</p>
<div class="field">
<div class="field wa-support">
<label class="lgn-label" for="name">{{t "InitMFAU2F.TokenNameLabel"}}</label>
<input class="lgn-input" type="text" id="name" name="name" autocomplete="off" autofocus>
</div>
@ -46,4 +46,3 @@
<script src="{{ resourceUrl "scripts/webauthn_register.js" }}"></script>
{{template "main-bottom" .}}

View File

@ -16,7 +16,7 @@
<input type="hidden" name="credentialAssertionData" value="{{ .CredentialCreationData }}"/>
<input type="hidden" name="credentialData"/>
<p class="wa-no-support error hidden">{{t "VerifyMFAU2F.NotSupported"}}</p>
<p class="wa-no-support lgn-error hidden">{{t "VerifyMFAU2F.NotSupported"}}</p>
<div id="wa-error" class="error hidden">
<span class="cause"></span>

View File

@ -15,7 +15,7 @@
<input type="hidden" name="credentialAssertionData" value="{{ .CredentialCreationData }}"/>
<input type="hidden" name="credentialData"/>
<p class="wa-no-support error hidden">{{t "Passwordless.NotSupported"}}</p>
<p class="wa-no-support lgn-error hidden">{{t "Passwordless.NotSupported"}}</p>
<div id="wa-error" class="error hidden">
<span class="cause"></span>
<span>{{t "Passwordless.ErrorRetry"}}</span>

View File

@ -23,7 +23,7 @@
<div class="fields">
<p class="wa-no-support lgn-error hidden">{{t "PasswordlessRegistration.NotSupported"}}</p>
{{if not .Disabled}}
<div class="field">
<div class="field wa-support">
<label class="lgn-label" for="name" disabled="false">{{t "PasswordlessRegistration.TokenNameLabel"}}</label>
<input class="lgn-input" type="text" id="name" name="name" autocomplete="off" autofocus>
</div>
@ -49,4 +49,3 @@
<script src="{{ resourceUrl "scripts/webauthn_register.js" }}"></script>
{{template "main-bottom" .}}