From ce11eff1b8b8c28d01268e39b122cf1e8def8424 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 10 Jul 2019 08:01:32 -0600 Subject: [PATCH] Simplify parameter check --- src/components/structures/auth/SoftLogout.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/structures/auth/SoftLogout.js b/src/components/structures/auth/SoftLogout.js index c58754e9f5..8bfa458c28 100644 --- a/src/components/structures/auth/SoftLogout.js +++ b/src/components/structures/auth/SoftLogout.js @@ -108,10 +108,9 @@ export default class SoftLogout extends React.Component { }; async _initLogin() { - const requiredQueryParams = ['homeserver', 'loginToken']; - const hasAllParams = requiredQueryParams - .filter(p => Object.keys(this.props.realQueryParams).includes(p)).length === requiredQueryParams.length; - if (this.props.realQueryParams && hasAllParams) { + const queryParams = this.props.realQueryParams; + const hasAllParams = queryParams && queryParams['homeserver'] && queryParams['loginToken']; + if (hasAllParams) { this.setState({loginView: LOGIN_VIEW.LOADING}); this.trySsoLogin(); return;