- const resClient = await getClient(url)
- const client = {
- id: resClient.body.client_id,
- secret: resClient.body.client_secret
- }
-
- const user = { username, password }
-
- let accessToken: string
- try {
- const res = await login(url, client, user)
- accessToken = res.body.access_token
- } catch (err) {
- throw new Error('Cannot authenticate. Please check your username/password.')
- }