diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index c9b6aa9b..d01a68d2 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -29,7 +29,8 @@ export function TPMIndexHOC(WrappedComponent) { giteaVisible:false, email:undefined, completeProfile:false, - showCP:false + showCP:false, + is_sync_pwd:undefined } } @@ -170,10 +171,11 @@ export function TPMIndexHOC(WrappedComponent) { }) } } - if(!response.data.has_gitea_user){ + if(!response.data.has_gitea_user || (response.data.has_gitea_user && !response.data.is_sync_pwd)){ this.setState({ giteaVisible:true, - email:response.data.email + email:response.data.email, + is_sync_pwd:response.data.is_sync_pwd }) } } @@ -225,8 +227,8 @@ export function TPMIndexHOC(WrappedComponent) { onOk =(values)=>{ let url = `/accounts/gitea_regsiter.json`; - const { email , current_user } = this.state; - if(email){ + const { email , current_user , is_sync_pwd } = this.state; + if(email && !is_sync_pwd){ url = `/users/change_password.json`; } axios.post(url,{