Simplify parameter check
This commit is contained in:
parent
2ca6633fda
commit
ce11eff1b8
1 changed files with 3 additions and 4 deletions
|
@ -108,10 +108,9 @@ export default class SoftLogout extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
async _initLogin() {
|
async _initLogin() {
|
||||||
const requiredQueryParams = ['homeserver', 'loginToken'];
|
const queryParams = this.props.realQueryParams;
|
||||||
const hasAllParams = requiredQueryParams
|
const hasAllParams = queryParams && queryParams['homeserver'] && queryParams['loginToken'];
|
||||||
.filter(p => Object.keys(this.props.realQueryParams).includes(p)).length === requiredQueryParams.length;
|
if (hasAllParams) {
|
||||||
if (this.props.realQueryParams && hasAllParams) {
|
|
||||||
this.setState({loginView: LOGIN_VIEW.LOADING});
|
this.setState({loginView: LOGIN_VIEW.LOADING});
|
||||||
this.trySsoLogin();
|
this.trySsoLogin();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue