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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user