forked from CGM_Public/pretix_original
WebAuthN: Replace sr-only with hidden css-class
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
<input class="form-control" name="token" placeholder="{% trans "Token" %}" autocomplete="one-time-code"
|
<input class="form-control" name="token" placeholder="{% trans "Token" %}" autocomplete="one-time-code"
|
||||||
type="text" required="required" autofocus="autofocus" id="webauthn-response">
|
type="text" required="required" autofocus="autofocus" id="webauthn-response">
|
||||||
</div>
|
</div>
|
||||||
<div class="sr-only alert alert-danger" id="webauthn-error">
|
<div class="alert alert-danger hidden" id="webauthn-error">
|
||||||
{% trans "WebAuthn failed. Check that the correct authentication device is correctly plugged in." %}
|
{% trans "WebAuthn failed. Check that the correct authentication device is correctly plugged in." %}
|
||||||
</div>
|
</div>
|
||||||
{% if jsondata %}
|
{% if jsondata %}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<button class="btn btn-primary sr-only" type="submit"></button>
|
<button class="btn btn-primary sr-only" type="submit"></button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="sr-only alert alert-danger" id="webauthn-error">
|
<div class="alert alert-danger hidden" id="webauthn-error">
|
||||||
{% trans "Device registration failed." %}
|
{% trans "Device registration failed." %}
|
||||||
</div>
|
</div>
|
||||||
<script type="text/json" id="webauthn-enroll">
|
<script type="text/json" id="webauthn-enroll">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<input class="form-control" id="webauthn-response" name="webauthn"
|
<input class="form-control" id="webauthn-response" name="webauthn"
|
||||||
type="hidden">
|
type="hidden">
|
||||||
{% if jsondata %}
|
{% if jsondata %}
|
||||||
<div class="sr-only alert alert-danger" id="webauthn-error">
|
<div class="alert alert-danger hidden" id="webauthn-error">
|
||||||
{% trans "WebAuthn failed. Check that the correct authentication device is correctly plugged in." %}
|
{% trans "WebAuthn failed. Check that the correct authentication device is correctly plugged in." %}
|
||||||
</div>
|
</div>
|
||||||
<p><small>
|
<p><small>
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ const startRegister = async (e) => {
|
|||||||
publicKey: publicKeyCredentialCreateOptions
|
publicKey: publicKeyCredentialCreateOptions
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
$("#webauthn-error").removeClass("sr-only");
|
$("#webauthn-error").removeClass("hidden");
|
||||||
return console.error("Error creating credential:", err);
|
return console.error("Error creating credential:", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ const startLogin = async (e) => {
|
|||||||
publicKey: transformedCredentialRequestOptions,
|
publicKey: transformedCredentialRequestOptions,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
$("#webauthn-error").removeClass("sr-only");
|
$("#webauthn-error").removeClass("hidden");
|
||||||
return console.error("Error when creating credential:", err);
|
return console.error("Error when creating credential:", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user