diff options
Diffstat (limited to 'js/gdm/credentialManager.js')
-rw-r--r-- | js/gdm/credentialManager.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/js/gdm/credentialManager.js b/js/gdm/credentialManager.js new file mode 100644 index 0000000..2ea9f72 --- /dev/null +++ b/js/gdm/credentialManager.js @@ -0,0 +1,27 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +/* exported CredentialManager */ + +const Signals = imports.misc.signals; + +var CredentialManager = class CredentialManager extends Signals.EventEmitter { + constructor(service) { + super(); + + this._token = null; + this._service = service; + } + + get token() { + return this._token; + } + + set token(t) { + this._token = t; + if (this._token) + this.emit('user-authenticated', this._token); + } + + get service() { + return this._service; + } +}; |