Skip to content

Commit 49d3a4f

Browse files
committed
OAuth2: isLoggedIn = false when expired #350 (#994)
1 parent d1d3680 commit 49d3a4f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/logic/Auth/OAuth2.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ export class OAuth2 extends WebBasedAuth {
164164
}
165165

166166
get isLoggedIn(): boolean {
167-
return !!this.accessToken;
167+
return !!this.accessToken && !this.isExpired;
168+
}
169+
170+
get isExpired(): boolean {
171+
return this.expiresAt
172+
? this.expiresAt.getTime() - 2000 < Date.now()
173+
: false;
168174
}
169175

170176
/**

0 commit comments

Comments
 (0)