Skip to content

Commit 35d617e

Browse files
committed
Check scoped always-auth option
1 parent 1b65ece commit 35d617e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/registries/npm-registry.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ export default class NpmRegistry extends Registry {
5252
request(pathname: string, opts?: RegistryRequestOptions = {}): Promise<*> {
5353
const registry = addSuffix(this.getRegistry(pathname), '/');
5454
const requestUrl = url.resolve(registry, pathname);
55+
const alwaysAuth = this.getScopedOption(registry.replace(/^https?:/, ''), 'always-auth')
56+
|| this.getOption('always-auth');
5557

5658
const headers = {};
57-
if (this.token || (this.getOption('always-auth') && requestUrl.startsWith(registry))) {
59+
if (this.token || (alwaysAuth && requestUrl.startsWith(registry))) {
5860
headers.authorization = this.getAuth(pathname);
5961
}
6062

0 commit comments

Comments
 (0)