Commit 1aa49183 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_officejs] Do not crash when getting 401

Notify the user and redirect to the storage page to force user to enter credentials if needed
parent 42fef3a8
......@@ -48,6 +48,13 @@
if (site) {
return gadget.redirect({ command: "row", url: site});
}
// User entered wrong password ?
// Notify
return gadget.notifySubmitted({message: 'Unauthorized storage access', status: 'error'})
.push(function () {
return gadget.redirect({command: 'display',
options: {page: 'ojs_configurator'}});
});
}
throw error;
});
......@@ -60,6 +67,7 @@
gadget.state_parameter_dict = {};
})
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>vincent</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.36985.29761.10359</string> </value>
<value> <string>973.43582.44368.54391</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1507216488.77</float>
<float>1550152243.11</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment