2020-01-03 11:31:15 -05:00
|
|
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
|
|
|
/* exported CredentialManager */
|
|
|
|
|
2020-10-28 15:26:18 -04:00
|
|
|
var CredentialManager = class CredentialManager {
|
2020-01-03 11:31:15 -05:00
|
|
|
constructor(service) {
|
|
|
|
this._token = null;
|
|
|
|
this._service = service;
|
|
|
|
this._authenticatedSignalId = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2020-10-28 15:26:18 -04:00
|
|
|
};
|