Skip to main content

max / makenotwork

549 B · 11 lines History Blame Raw
1 // Offer the passkey button only where the browser can do WebAuthn.
2 //
3 // The container is a described `RegionKind::Handover` (`crate::quasi::auth_pages`),
4 // so its markup is the renderer's and this script cannot ship a class on it.
5 // It states the answer as a data attribute instead and `style.css` keys the
6 // region off that, which is the same arrangement the header's cart place uses.
7 var passkeyLogin = document.getElementById('passkey-login');
8 if (window.PublicKeyCredential && passkeyLogin) {
9 passkeyLogin.dataset.supported = 'true';
10 }
11