Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 8a9b760

Browse files
committed
Improve UX for browsers we don't support U2F in
1 parent 9b03461 commit 8a9b760

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

themes/material/mfa/prompt-for-mfa-u2f.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function createHiddenInput(name) {
8787
</script>
8888
</head>
8989

90-
<body class="gradient-bg" onload="verifyU2f()">
90+
<?php $isU2fSupported = $this->data['supportsU2f']; ?>
91+
92+
<body class="gradient-bg" onload="<?= $isU2fSupported ? 'verifyU2f()' : '' ?>">
9193
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
9294
<header class="mdl-layout__header">
9395
<div class="mdl-layout__header-row">
@@ -111,11 +113,19 @@ class="icon">
111113
</h1>
112114
</div>
113115

116+
<?php if ($isU2fSupported): ?>
114117
<div class="mdl-card__title">
115118
<p class="mdl-card__subtitle-text">
116119
<?= $this->t('{material:mfa:u2f_instructions}') ?>
117120
</p>
118121
</div>
122+
<?php else: ?>
123+
<div class="mdl-card__title">
124+
<p class="mdl-typography--text-center mdl-color-text--red">
125+
<?= $this->t('{material:mfa:u2f_unsupported}') ?>
126+
</p>
127+
</div>
128+
<?php endif; ?>
119129

120130
<?php
121131
$message = $this->data['errorMessage'];

0 commit comments

Comments
 (0)