not supported scenario

This commit is contained in:
Kyle Spearrin 2017-06-27 09:04:51 -04:00
parent 075ba931ea
commit 9f1c445214
4 changed files with 21 additions and 3 deletions

View File

@ -90,10 +90,19 @@ angular
for (var i = 0; i < keys.length; i++) {
var provider = $filter('filter')(constants.twoFactorProviderInfo, { type: keys[i], active: true });
if (provider.length && provider[0].priority > providerPriority) {
if (provider[0].type === constants.twoFactorProvider.u2f && !u2f.isSupported) {
continue;
}
providerType = provider[0].type;
providerPriority = provider[0].priority;
}
}
if (providerType === null) {
return null;
}
return parseInt(providerType);
}

View File

@ -18,7 +18,7 @@
if (providers.hasOwnProperty(constants.twoFactorProvider.duo)) {
add(constants.twoFactorProvider.duo);
}
if (providers.hasOwnProperty(constants.twoFactorProvider.u2f)) {
if (providers.hasOwnProperty(constants.twoFactorProvider.u2f) && u2f.isSupported) {
add(constants.twoFactorProvider.u2f);
}

View File

@ -143,6 +143,15 @@
</form>
</div>
<div ng-if="twoFactorProvider === null">
<p>
This account has two-factor login enabled, however, none of the configured two-factor providers are supported by this
web browser.
</p>
Please use a supported web browser (such as Chrome) and/or add additional providers that are better supported
across web browsers (such as an Authenticator App).
</div>
<hr />
<ul>
<li>
@ -151,4 +160,4 @@
<li>
<a ui-sref="frontend.login.info({returnState: returnState})">Back to log in</a>
</li>
</ul>
</ul>

View File

@ -22,7 +22,7 @@ var u2f = u2f || {};
* Modification:
* Check if browser supports U2F API before this wrapper was added.
*/
u2f.isSupported = ((typeof u2f !== 'undefined') && u2f.register) || (chrome && chrome.runtime);
u2f.isSupported = !!(((typeof u2f !== 'undefined') && u2f.register) || (chrome && chrome.runtime));
/**
* FIDO U2F Javascript API Version