refactor: improve async handling

This commit is contained in:
Carlos Valente
2025-02-15 14:05:53 +01:00
committed by Carlos Valente
parent c65761448d
commit 891bda6661
8 changed files with 88 additions and 87 deletions
@@ -114,18 +114,13 @@ async function getDeviceCodes(clientSecret: ClientSecret): Promise<CodesResponse
/**
* Gets credentials from Google Auth server
* @param clientSecret
* @param device_code
* @param interval
* @param expires_in
* @param postAction
*/
function verifyConnection(
clientSecret: ClientSecret,
device_code: string,
interval: number,
expires_in: number,
postAction: () => void,
postAction: () => Promise<any>,
) {
// create poller to check for auth
pollInterval = setInterval(pollForAuth, interval * 1000);