diff --git a/src/puter-js/src/index.js b/src/puter-js/src/index.js index 70528b0a1..51f734bdb 100644 --- a/src/puter-js/src/index.js +++ b/src/puter-js/src/index.js @@ -458,6 +458,7 @@ const puterInit = (function () { registerModule (name, cls, parameters = {}) { const instance = new cls(this.context, parameters); + instance.puter = this; this.modules_.push(name); this[name] = instance; if ( instance._init ) instance._init({ puter: this }); diff --git a/src/puter-js/src/modules/Perms.js b/src/puter-js/src/modules/Perms.js index c43fe4b8b..5e555f173 100644 --- a/src/puter-js/src/modules/Perms.js +++ b/src/puter-js/src/modules/Perms.js @@ -131,7 +131,7 @@ export default class Perms { permission: `user:${whoami.uuid}:email:read`, }); if ( granted ) { - whoami = await puter.auth.whoami(); + whoami = await this.puter.auth.whoami(); } return whoami.email; }