feat: sync library

This commit is contained in:
Zamitto 2024-06-15 02:15:58 -03:00
parent 79ca354da1
commit da5cc11bff
6 changed files with 167 additions and 7 deletions

View file

@ -14,6 +14,10 @@ export class HydraApi {
expirationTimestamp: 0,
};
static isLoggedIn() {
return this.userAuth.authToken !== "";
}
static async handleExternalAuth(auth: string) {
const { payload } = url.parse(auth, true).query;
@ -140,4 +144,9 @@ export class HydraApi {
await this.revalidateAccessTokenIfExpired();
return this.instance.patch(url, data, this.getAxiosConfig());
}
static async delete(url: string) {
await this.revalidateAccessTokenIfExpired();
return this.instance.delete(url, this.getAxiosConfig());
}
}