From 280cef4235bf4dc06aaf1288bbbbe848f65b6df4 Mon Sep 17 00:00:00 2001 From: Badisi Date: Fri, 9 Dec 2022 19:06:01 +0100 Subject: [PATCH] fix(ngx-auth): also auto inject token for hostnames starting with api --- projects/ngx-auth/core/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ngx-auth/core/main.ts b/projects/ngx-auth/core/main.ts index fa69e26..6654a2e 100644 --- a/projects/ngx-auth/core/main.ts +++ b/projects/ngx-auth/core/main.ts @@ -10,7 +10,7 @@ const DEFAULT_SETTINGS: Optional = { automaticInjectToken: { include: (url: string): boolean => { const res = new URL(url, 'http://default-base'); - return res.pathname.startsWith('/api') || false; + return res.hostname.startsWith('api') || res.pathname.startsWith('/api') || false; } } };