1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-04 15:54:48 +01:00

remove /admin/me call, which is no longer available, and use the new api_credentials Object, which used to be a String.

add X-Requested-With header to requests so 401's are not returned by daemon.py.
This commit is contained in:
downtownallday
2021-09-14 10:00:17 -04:00
parent 9ea03e18c9
commit 763cdfcd7e
2 changed files with 66 additions and 27 deletions

View File

@@ -29,22 +29,20 @@ const app = {
},
data: {
me: null,
},
mounted: function() {
this.getMe();
this.ensure_authenticated();
},
methods: {
getMe: function() {
axios.get('me').then(response => {
this.me = new Me(response.data);
}).catch(error => {
this.handleError(error);
});
ensure_authenticated: function() {
axios.get('reports/uidata/user-list')
.catch(error => {
this.handleError(error);
});
},
handleError: function(error) {
if (error instanceof AuthenticationError) {
console.log(error);