diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 8e259048..e6f6372a 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -13,6 +13,7 @@ export interface Credentials { clientSecret?: string; totp?: string; offlineToken?: boolean; + refreshToken?: string; } export interface Settings { @@ -49,7 +50,12 @@ export const getToken = async (settings: Settings): Promise => { client_id: credentials.clientId, totp: credentials.totp, ...(credentials.offlineToken ? {scope: 'offline_access'} : {}), + ...(credentials.refreshToken ? { + refresh_token: credentials.refreshToken, + client_secret: credentials.clientSecret, + } : {}), }); + const config: AxiosRequestConfig = { ...settings.requestConfig, };