diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 54412381..a00cebf2 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -165,10 +165,12 @@ export function TPMIndexHOC(WrappedComponent) { this.setState({ tpmLoading: false }) - const { pathname } = this.props.history.location; - console.log("pathname ",pathname); - if(pathname ==="/"){ - this.props.history.push(`/users/${response.data.login}`); + if(response.data.login){ + const { pathname } = this.props.history.location; + console.log("pathname ",pathname); + if(pathname ==="/"){ + this.props.history.push(`/users/${response.data.login}`); + } } } }).catch((error) => {