Ensure that the master password dialog is popped up if the crypt key is missing. Fixes #6960

This commit is contained in:
Akshay Joshi
2022-04-04 17:00:18 +05:30
parent ae7059aec1
commit 38278c179e
6 changed files with 51 additions and 23 deletions

View File

@@ -530,17 +530,11 @@ function SchemaDialogView({
});
setFormReady(true);
setLoaderText('');
}).catch((err)=>{
}).catch(()=>{
if(unmounted) {
return;
}
setLoaderText('');
if (err.response && err.response.data && err.response.data.errormsg) {
Notify.alert(
gettext(err.response.statusText),
gettext(err.response.data.errormsg)
);
}
});
/* Clear the focus timeout if unmounted */
return ()=>{
@@ -819,14 +813,8 @@ function SchemaPropertiesView({
setOrigData(data || {});
setLoaderText('');
}
}).catch((err)=>{
}).catch(()=>{
setLoaderText('');
if (err.response && err.response.data && err.response.data.errormsg) {
Notify.alert(
gettext(err.response.statusText),
gettext(err.response.data.errormsg)
);
}
});
}, [getInitData]);

View File

@@ -196,10 +196,14 @@ var Notifier = {
if(resp.info == 'CRYPTKEY_MISSING') {
var pgBrowser = window.pgAdmin.Browser;
pgBrowser.set_master_password('', ()=> {
pgBrowser.set_master_password('', false, ()=> {
if(onJSONResult && typeof(onJSONResult) == 'function') {
onJSONResult('CRYPTKEY_SET');
}
}, ()=> {
if(onJSONResult && typeof(onJSONResult) == 'function') {
onJSONResult('CRYPTKEY_NOT_SET');
}
});
return;
} else if (resp.result != null && (!resp.errormsg || resp.errormsg == '') &&