mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-12 19:55:19 +02:00
fix google disconnect issue
This commit is contained in:
parent
6c9ccc0f95
commit
56fd33e4fe
2 changed files with 6 additions and 6 deletions
|
|
@ -213,11 +213,12 @@ export async function refreshTokens(
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if tokens are expired
|
||||
* Check if tokens are expired (or will expire within the buffer period)
|
||||
*/
|
||||
const EXPIRY_BUFFER_SECONDS = 5 * 60; // Refresh 5 minutes before expiry
|
||||
export function isTokenExpired(tokens: OAuthTokens): boolean {
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
return tokens.expires_at <= now;
|
||||
return tokens.expires_at <= now + EXPIRY_BUFFER_SECONDS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -79,10 +79,9 @@ export class FSOAuthRepo implements IOAuthRepo {
|
|||
if (!tokens) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if token is expired
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
return tokens.expires_at > now;
|
||||
|
||||
// Connected as long as we have a refresh token (access tokens can be refreshed on demand)
|
||||
return tokens.refresh_token != null;
|
||||
}
|
||||
|
||||
async getConnectedProviders(): Promise<string[]> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue