I would suggest having no default at all, and making #getIssuer a callback parameter. If there is a default I would make it based on user-interaction with a pop-up.
|
async #getIssuer(request: Request): Promise<URL> { |
|
if (request.url.includes(".solidcommunity.net")) { |
|
return new URL("https://solidcommunity.net") |
|
} else if (request.url.includes("datapod.igrant.io")) { |
|
return new URL("https://datapod.igrant.io") |
|
} else if (request.url.includes(".solidweb.app")) { |
|
return new URL("https://solidweb.app") |
|
} else if (request.url.includes("storage.inrupt.com")) { |
|
return new URL("https://login.inrupt.com") |
|
} else if (request.url.includes("teamid.live")) { |
|
return new URL("https://teamid.live") |
|
} else if (request.url.includes(".solidweb.org")) { |
|
return new URL("https://solidweb.org") |
|
} else if (request.url.includes("localhost:3000")) { |
|
return new URL("http://localhost:3000") |
|
} else { |
|
throw new Error(`Unknown issuer ${request.url}`) |
|
} |
|
} |
I would suggest having no default at all, and making
#getIssuera callback parameter. If there is a default I would make it based on user-interaction with a pop-up.reactive-authentication/src/DPoPTokenProvider.ts
Lines 13 to 31 in c733a88