mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
feat: moved some useful tools to common
This commit is contained in:
committed by
Chi Vinh Le
parent
3c64bb0240
commit
c81d612c70
@@ -1,6 +1,8 @@
|
||||
import fetch from "node-fetch";
|
||||
import { URL } from "url";
|
||||
|
||||
import { ensureNoEndSlash } from "talk-common/utils";
|
||||
|
||||
/**
|
||||
* Configuration that Talk is expecting.
|
||||
*/
|
||||
@@ -35,8 +37,7 @@ export async function discover(
|
||||
// Any provider MUST provide a .well-known url that is JSON parsable based
|
||||
// on the issuer: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig
|
||||
const configurationURL =
|
||||
issuer.origin +
|
||||
issuer.pathname.replace(/\/$/, "") +
|
||||
ensureNoEndSlash(issuer.origin + issuer.pathname) +
|
||||
"/.well-known/openid-configuration";
|
||||
const res = await fetch(configurationURL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user