Save token with JSON

pull/73/head
MillenniumEarl 2021-03-03 11:31:36 +01:00
parent b664f78941
commit 08d4476591
1 changed files with 8 additions and 6 deletions

View File

@ -33,23 +33,23 @@ export default class Session {
/** /**
* Path of the session map file on disk. * 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. * 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. * 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. * 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. * Token used to login to F95Zone.
*/ */
public get token() { return this._token; }; public get token() { return this._token; }
//#endregion Getters //#endregion Getters
@ -86,6 +86,7 @@ export default class Session {
return { return {
_created: this._created, _created: this._created,
_hash: this._hash, _hash: this._hash,
_token: this._token,
}; };
} }
@ -94,7 +95,7 @@ export default class Session {
//#region Public Methods //#region Public Methods
/** /**
* Create a new session * Create a new session.
*/ */
create(username: string, password: string, token: string): void { create(username: string, password: string, token: string): void {
// First, create the _hash of the credentials // First, create the _hash of the credentials
@ -135,6 +136,7 @@ export default class Session {
// Assign values // Assign values
this._created = json._created; this._created = json._created;
this._hash = json._hash; this._hash = json._hash;
this._token = json._token;
} }
} }