Skip to content

Commit

Permalink
Pass environment and endpoint (fixes #103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneezry authored and chrmarti committed Nov 7, 2018
1 parent d8de6da commit a954e04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/azure-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,8 @@ export async function tokenFromRefreshToken(environment: AzureEnvironment, refre
async function tokensFromToken(environment: AzureEnvironment, firstTokenResponse: TokenResponse) {
const tokenCache = new MemoryCache();
await addTokenToCache(environment, tokenCache, firstTokenResponse);
const credentials = new DeviceTokenCredentials({ username: firstTokenResponse.userId, clientId, tokenCache });
const client = new SubscriptionClient.SubscriptionClient(credentials);
const credentials = new DeviceTokenCredentials({ username: firstTokenResponse.userId, clientId, tokenCache, environment });
const client = new SubscriptionClient.SubscriptionClient(credentials, environment.resourceManagerEndpointUrl);
const tenants = await listAll(client.tenants, client.tenants.list());
const responses = <TokenResponse[]>(await Promise.all<TokenResponse | null>(tenants.map((tenant, i) => {
if (tenant.tenantId === firstTokenResponse.tenantId) {
Expand Down

0 comments on commit a954e04

Please sign in to comment.