mirror of
https://github.com/HeyPuter/puter.git
synced 2026-02-26 11:59:20 -06:00
fix: undefined APIOrigin
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user