Allow dynamic MSAL Authority (#896)

This commit is contained in:
Steve Faulkner
2021-06-16 09:13:11 -05:00
committed by GitHub
parent 914c372f5b
commit 6f68c75257
7 changed files with 23 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import { useEffect, useState } from "react";
import { configContext } from "../ConfigContext";
import { Tenant } from "../Contracts/DataModels";
interface TenantListResult {
@@ -13,7 +14,7 @@ export async function fetchDirectories(accessToken: string): Promise<Tenant[]> {
headers.append("Authorization", bearer);
let tenents: Array<Tenant> = [];
let nextLink = `https://management.azure.com/tenants?api-version=2020-01-01`;
let nextLink = `${configContext.ARM_ENDPOINT}/tenants?api-version=2020-01-01`;
while (nextLink) {
const response = await fetch(nextLink, { headers });