Simplify parameter check

pull/21833/head
Travis Ralston 2019-07-10 08:01:32 -06:00
parent 2ca6633fda
commit ce11eff1b8
1 changed files with 3 additions and 4 deletions

View File

@ -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;