diff --git a/src/common/pages/Login/LoginBtn.js b/src/common/pages/Login/LoginBtn.js index 1e13256..7008a9f 100644 --- a/src/common/pages/Login/LoginBtn.js +++ b/src/common/pages/Login/LoginBtn.js @@ -36,7 +36,8 @@ class BTNLoginPage extends React.Component{ password: "", showPassword : false, isLoading: false, - loginFailed: false + loginFailed: false, + isNeedEmailVerification: false, }; this.defaultState = Object.assign({}, this.state); this.authStore = props.appstate.auth; @@ -63,10 +64,15 @@ class BTNLoginPage extends React.Component{ password: password, } this.authStore.login(data).then(res => { - setTimeout(()=>{ - this.props.history.push(LINKS.DASHBOARD); - this.setState({isLoading:false}); - },1000); + if(!res.need_email_verification){ + setTimeout(()=>{ + this.props.history.push(LINKS.DASHBOARD); + this.setState({isLoading:false}); + },1000); + } + else{ + this.setState({isNeedEmailVerification:true}); + } }).catch(err => { this.setState({loginFailed:true,isLoading:false}); setTimeout(()=>this.setState({loginFailed:false}),3000); @@ -122,50 +128,72 @@ class BTNLoginPage extends React.Component{ - - - Login to BTN Point - - - Doesn't have an account? Register - - - {/*
*/} - - - {this.state.showPassword ? : } - - - ), - }} - /> -
- -
- + { + this.state.isNeedEmailVerification && + + + Your account still need email verification + + + Still not received any email? Resend email + + +
+ +
+
+ } + + { + !this.state.isNeedEmailVerification && + + + Login to BTN Point + + + Doesn't have an account? Register + + + {/*
*/} + + + {this.state.showPassword ? : } + + + ), + }} + /> +
+ +
+ + } +