mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed BigAnimal authentication aborted issue. #5629
This commit is contained in:
parent
a5af64b907
commit
bb07d36963
@ -290,6 +290,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose, cloudPanel})
|
|||||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('EDB BigAnimal authentication process is in progress...') + '<img src="' + loading_icon_url + '" alt="' + gettext('Loading...') + '">']);
|
setErrMsg([MESSAGE_TYPE.INFO, gettext('EDB BigAnimal authentication process is in progress...') + '<img src="' + loading_icon_url + '" alt="' + gettext('Loading...') + '">']);
|
||||||
let child = window.open(verificationURI, 'edb_biganimal_authentication');
|
let child = window.open(verificationURI, 'edb_biganimal_authentication');
|
||||||
let _url = url_for('biganimal.verification_ack') ;
|
let _url = url_for('biganimal.verification_ack') ;
|
||||||
|
let countdown = 60;
|
||||||
const myInterval = setInterval(() => {
|
const myInterval = setInterval(() => {
|
||||||
axiosApi.get(_url)
|
axiosApi.get(_url)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@ -297,17 +298,15 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose, cloudPanel})
|
|||||||
setErrMsg([MESSAGE_TYPE.SUCCESS, gettext('Authentication completed successfully. Click the Next button to proceed.')]);
|
setErrMsg([MESSAGE_TYPE.SUCCESS, gettext('Authentication completed successfully. Click the Next button to proceed.')]);
|
||||||
setVerificationIntiated(true);
|
setVerificationIntiated(true);
|
||||||
clearInterval(myInterval);
|
clearInterval(myInterval);
|
||||||
}
|
} else if (res.data && res.data.success == 0 && res.data.errormsg == 'access_denied') {
|
||||||
else if (res.data && res.data.success == 0 && res.data.errormsg == 'access_denied') {
|
|
||||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('Verification failed. Access Denied...')]);
|
setErrMsg([MESSAGE_TYPE.INFO, gettext('Verification failed. Access Denied...')]);
|
||||||
setVerificationIntiated(false);
|
setVerificationIntiated(false);
|
||||||
clearInterval(myInterval);
|
clearInterval(myInterval);
|
||||||
}
|
} else if (res.data && res.data.success == 0 && res.data.errormsg == 'forbidden') {
|
||||||
else if (res.data && res.data.success == 0 && res.data.errormsg == 'forbidden') {
|
|
||||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('Authentication completed successfully but you do not have permission to create the cluster.')]);
|
setErrMsg([MESSAGE_TYPE.INFO, gettext('Authentication completed successfully but you do not have permission to create the cluster.')]);
|
||||||
setVerificationIntiated(false);
|
setVerificationIntiated(false);
|
||||||
clearInterval(myInterval);
|
clearInterval(myInterval);
|
||||||
}else if (child.closed) {
|
} else if (child.closed && !verificationIntiated && countdown <= 0) {
|
||||||
setVerificationIntiated(false);
|
setVerificationIntiated(false);
|
||||||
setErrMsg([MESSAGE_TYPE.ERROR, gettext('Authentication is aborted.')]);
|
setErrMsg([MESSAGE_TYPE.ERROR, gettext('Authentication is aborted.')]);
|
||||||
clearInterval(myInterval);
|
clearInterval(myInterval);
|
||||||
@ -316,6 +315,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose, cloudPanel})
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setErrMsg([MESSAGE_TYPE.ERROR, gettext(`Error while verifying EDB BigAnimal: ${error.response.data.errormsg}`)]);
|
setErrMsg([MESSAGE_TYPE.ERROR, gettext(`Error while verifying EDB BigAnimal: ${error.response.data.errormsg}`)]);
|
||||||
});
|
});
|
||||||
|
countdown = countdown - 1;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
cloudPanel.on(window.wcDocker.EVENT.CLOSED, function() {
|
cloudPanel.on(window.wcDocker.EVENT.CLOSED, function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user