Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function getClient(): Promise {
const credentials = JSON.parse(
await readLine(
'Paste Google Calendar credentials (1Password "Release automation Google Calendar API App credentials"): ',
'.secrets/google-calendar-credentials.json'
)
)
const { client_secret, client_id, redirect_uris } = credentials.installed
const oauth2Client = new OAuth2Client(client_id, client_secret, redirect_uris[0])
oauth2Client.setCredentials(await getAccessToken(oauth2Client))
return oauth2Client
}