This commit is contained in:
ammarahm-ed
2020-02-12 02:09:08 +05:00
parent 5608d8720c
commit 04af9e1668
3 changed files with 14 additions and 5 deletions

View File

@@ -32,9 +32,9 @@ export default class User {
}
async token() {
let user = await this.user();
let user = await this.get();
if (!user) return;
if (user.expiry < Date.now()) {
if (user.expiry > Date.now()) {
return user.accessToken;
}
let response = await authRequest("oauth/token", {