* Constructs the well-known path for auth-related metadata discovery
(
wellKnownPrefix: 'oauth-authorization-server' | 'oauth-protected-resource' | 'openid-configuration',
pathname: string = '',
options: { prependPathname?: boolean } = {}
)
| 793 | * Constructs the well-known path for auth-related metadata discovery |
| 794 | */ |
| 795 | function buildWellKnownPath( |
| 796 | wellKnownPrefix: 'oauth-authorization-server' | 'oauth-protected-resource' | 'openid-configuration', |
| 797 | pathname: string = '', |
| 798 | options: { prependPathname?: boolean } = {} |
| 799 | ): string { |
| 800 | // Strip trailing slash from pathname to avoid double slashes |
| 801 | if (pathname.endsWith('/')) { |
| 802 | pathname = pathname.slice(0, -1); |
| 803 | } |
| 804 | |
| 805 | return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`; |
| 806 | } |
| 807 | |
| 808 | /** |
| 809 | * Tries to discover OAuth metadata at a specific URL |
no outgoing calls
no test coverage detected
searching dependent graphs…