Skip to content

Commit

Permalink
fix(ngx-auth): also auto inject token for hostnames starting with api
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Dec 9, 2022
1 parent aff0885 commit 280cef4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/ngx-auth/core/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DEFAULT_SETTINGS: Optional<AuthSettings, 'authorityUrl' | 'clientId'> = {
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;
}
}
};
Expand Down

0 comments on commit 280cef4

Please sign in to comment.