fnbr
Version:
A library to interact with Epic Games' Fortnite HTTP and XMPP services
25 lines • 864 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const Base_1 = tslib_1.__importDefault(require("../Base"));
const AsyncLock_1 = tslib_1.__importDefault(require("../util/AsyncLock"));
/**
* Represents an auth session
*/
class AuthSession extends Base_1.default {
constructor(client, data, clientSecret, type) {
super(client);
this.accessToken = data.access_token;
this.expiresAt = new Date(data.expires_at);
this.accountId = data.account_id;
this.clientId = data.client_id;
this.type = type;
this.clientSecret = clientSecret;
this.refreshLock = new AsyncLock_1.default();
}
get isExpired() {
return this.expiresAt.getTime() < Date.now();
}
}
exports.default = AuthSession;
//# sourceMappingURL=AuthSession.js.map