diff --git a/pairent_frontend_react/src/API/APIToken.js b/pairent_frontend_react/src/API/APIToken.js new file mode 100644 index 0000000..9ee000f --- /dev/null +++ b/pairent_frontend_react/src/API/APIToken.js @@ -0,0 +1,30 @@ +import { IAPIObject } from "./IAPIObject"; + +class APIToken extends IAPIObject { + + static storage_key = 'pairent_api_key'; + + constructor(data) { + super(); + this.user = data.user; + this.key = data.key; + this.expires = data.expires; + this.ip = data.ip; + } + + /** @type {number} */ + user; + + /** @type {string} */ + key; + + /** A Unix timestamp (when the token will expire) + * @type {number} + */ + expires; + + /** @type {string} */ + ip; +} + +export { APIToken }; \ No newline at end of file diff --git a/pairent_frontend_react/src/API/User.js b/pairent_frontend_react/src/API/User.js index 99b84f7..d62bb42 100644 --- a/pairent_frontend_react/src/API/User.js +++ b/pairent_frontend_react/src/API/User.js @@ -16,33 +16,6 @@ class UserLoginResponse { id; } -class APIToken extends IAPIObject { - - static storage_key = 'pairent_api_key'; - - constructor(data) { - super(); - this.user = data.user; - this.key = data.key; - this.expires = data.expires; - this.ip = data.ip; - } - - /** @type {number} */ - user; - - /** @type {string} */ - key; - - /** A Unix timestamp (when the token will expire) - * @type {number} - */ - expires; - - /** @type {string} */ - ip; -} - class User extends IAPIObject { isLoggedIn() {