mirror of
https://github.com/janishutz/oidc-login-sdk.git
synced 2026-10-08 17:36:20 +02:00
fix: request module URL computation improvements
This commit is contained in:
1 parent
781d03a029
commit
1cccd1619f
1 file changed
+6
-3
@@ -59,11 +59,14 @@ export const deleteRequest = async ( url: string, authErrorResolution?: AuthErro
|
|||||||
* @returns The URL to the backend
|
* @returns The URL to the backend
|
||||||
*/
|
*/
|
||||||
export const getBackendURL = () => {
|
export const getBackendURL = () => {
|
||||||
return config.get().backendURL;
|
return new URL( config.get().backendURL.toString() );
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrapper = async ( url: string, opts: RequestInit, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
const wrapper = async ( path: string, opts: RequestInit, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||||
const res = await fetch( config.get().backendURL + url, {
|
const url = getBackendURL();
|
||||||
|
|
||||||
|
url.pathname = path;
|
||||||
|
const res = await fetch( url.toString(), {
|
||||||
'redirect': 'manual',
|
'redirect': 'manual',
|
||||||
...opts
|
...opts
|
||||||
} );
|
} );
|
||||||
|
|||||||
Reference in new issue
Block a user