fix: undefined APIOrigin

This commit is contained in:
KernelDeimos
2024-12-01 19:29:39 -05:00
parent ae42f6301f
commit 340c7a821f
2 changed files with 8 additions and 5 deletions

View File

@@ -27,8 +27,10 @@ export class APIAccessService extends putility.concepts.Service {
const self = this;
const o = {};
[
['auth_token','auth_token'],
['authToken','auth_token'],
['APIOrigin','api_origin'],
['api_origin','api_origin'],
].forEach(([k1,k2]) => {
Object.defineProperty(o, k1, {
get () {

View File

@@ -63,15 +63,16 @@ export class FilesystemService extends putility.concepts.Service {
this.fs_proxy_.delegate = this.fs_nocache_;
}
initializeSocket () {
async initializeSocket () {
if (this.socket) {
this.socket.disconnect();
}
this.socket = io(this.APIOrigin, {
auth: {
auth_token: this.authToken,
}
const svc_apiAccess = this._.context.services.get('api-access');
const api_info = svc_apiAccess.get_api_info();
this.socket = io(api_info.api_origin, {
auth: { auth_token: api_info.auth_token }
});
this.bindSocketEvents();