combine token stripping logic, use utils
This commit is contained in:
parent
53d6b9d704
commit
a594b14f27
|
@ -27,7 +27,7 @@ class AppContainer extends Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = this.getQueryToken();
|
const token = getQueryToken(this.props.lcation);
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return;
|
return;
|
||||||
|
@ -56,14 +56,10 @@ class AppContainer extends Component {
|
||||||
this.props.authenticate(this.props.credentials.host, this.props.credentials.token);
|
this.props.authenticate(this.props.credentials.host, this.props.credentials.token);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getQueryToken() &&
|
if (getQueryToken(this.props.location) &&
|
||||||
!this.props.credentials.authenticated &&
|
(!this.props.credentials.authenticating ||
|
||||||
!this.props.credentials.authenticating) {
|
this.props.credentials.authenticated)) {
|
||||||
this.props.history.replace(this.stripQueryToken(this.props.location));
|
this.props.history.replace(stripQueryToken(this.props.location));
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getQueryToken() && this.props.credentials.authenticated) {
|
|
||||||
this.props.history.replace(this.stripQueryToken(this.props.location));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.credentials.authenticated && !this.props.initialized) {
|
if (this.props.credentials.authenticated && !this.props.initialized) {
|
||||||
|
|
Loading…
Reference in New Issue