From 08d44765917d33b8725ef4c50d2fc24ba5f1dcfe Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Wed, 3 Mar 2021 11:31:36 +0100 Subject: [PATCH] Save token with JSON --- src/scripts/classes/session.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/scripts/classes/session.ts b/src/scripts/classes/session.ts index b2e8d18..fcc62ee 100644 --- a/src/scripts/classes/session.ts +++ b/src/scripts/classes/session.ts @@ -33,23 +33,23 @@ export default class Session { /** * Path of the session map file on disk. */ - public get path() { return this._path; }; + public get path() { return this._path; } /** * Indicates if the session is mapped on disk. */ - public get isMapped() { return this._isMapped; }; + public get isMapped() { return this._isMapped; } /** * Date of creation of the session. */ - public get created() { return this._created; }; + public get created() { return this._created; } /** * MD5 hash of the username and the password. */ - public get hash() { return this._hash; }; + public get hash() { return this._hash; } /** * Token used to login to F95Zone. */ - public get token() { return this._token; }; + public get token() { return this._token; } //#endregion Getters @@ -86,6 +86,7 @@ export default class Session { return { _created: this._created, _hash: this._hash, + _token: this._token, }; } @@ -94,7 +95,7 @@ export default class Session { //#region Public Methods /** - * Create a new session + * Create a new session. */ create(username: string, password: string, token: string): void { // First, create the _hash of the credentials @@ -135,6 +136,7 @@ export default class Session { // Assign values this._created = json._created; this._hash = json._hash; + this._token = json._token; } }