import axios from 'axios'; import { WellKnownEndpoints } from '../common/types'; /** * This function returns the well known endpoints of id-service. * @param authEndpoint URL for id-service authEndpoint. * @returns {WellKnownEndpoints} Well known endpoints of id-service. */ export async function getWellKnownEndpoints( authEndpoint: string, ): Promise { const wellKnownEndpointUrl = new URL(`/.well-known`, `${authEndpoint}`).href; const result: WellKnownEndpoints = (await axios.get(wellKnownEndpointUrl)) .data; return result; }