From d4d5088324a949ce542f6e04ed171f3262c3f063 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 8 Aug 2018 10:37:25 +0100 Subject: [PATCH] FIX: Don't require device capabilities when calculating login methods --- .../controllers/preferences/second-factor.js.es6 | 8 +------- .../javascripts/discourse/models/login-method.js.es6 | 5 ++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 index 29ef5626368..279a03f3cba 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 @@ -34,13 +34,7 @@ export default Ember.Controller.extend({ @computed displayOAuthWarning() { - return ( - findAll( - this.siteSettings, - getOwner(this).lookup("capabilities:main"), - this.site.isMobileDevice - ).length > 0 - ); + return findAll().length > 0; }, toggleSecondFactor(enable) { diff --git a/app/assets/javascripts/discourse/models/login-method.js.es6 b/app/assets/javascripts/discourse/models/login-method.js.es6 index 143deec081f..aba619ee94b 100644 --- a/app/assets/javascripts/discourse/models/login-method.js.es6 +++ b/app/assets/javascripts/discourse/models/login-method.js.es6 @@ -86,7 +86,10 @@ export function findAll(siteSettings, capabilities, isMobileDevice) { }); // On Mobile, Android or iOS always go with full screen - if (isMobileDevice || capabilities.isIOS || capabilities.isAndroid) { + if ( + isMobileDevice || + (capabilities && (capabilities.isIOS || capabilities.isAndroid)) + ) { methods.forEach(m => m.set("full_screen_login", true)); }