Browse Source

Always recommend using global config to store auth tokens

Jordi Boggiano 7 years ago
parent
commit
2eb69cd679
3 changed files with 6 additions and 6 deletions
  1. 3 3
      src/Composer/Util/Bitbucket.php
  2. 2 2
      src/Composer/Util/GitHub.php
  3. 1 1
      src/Composer/Util/GitLab.php

+ 3 - 3
src/Composer/Util/Bitbucket.php

@@ -109,7 +109,7 @@ class Bitbucket
                 return false;
             } elseif (in_array($e->getCode(), array(403, 401))) {
                 $this->io->writeError('<error>Invalid OAuth consumer provided.</error>');
-                $this->io->writeError('You can also add it manually later by using "composer config bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');
+                $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');
 
                 return false;
             }
@@ -144,7 +144,7 @@ class Bitbucket
 
         if (!$consumerKey) {
             $this->io->writeError('<warning>No consumer key given, aborting.</warning>');
-            $this->io->writeError('You can also add it manually later by using "composer config bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');
+            $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');
 
             return false;
         }
@@ -153,7 +153,7 @@ class Bitbucket
 
         if (!$consumerSecret) {
             $this->io->writeError('<warning>No consumer secret given, aborting.</warning>');
-            $this->io->writeError('You can also add it manually later by using "composer config bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');
+            $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');
 
             return false;
         }

+ 2 - 2
src/Composer/Util/GitHub.php

@@ -94,7 +94,7 @@ class GitHub
 
         if (!$token) {
             $this->io->writeError('<warning>No token given, aborting.</warning>');
-            $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"');
+            $this->io->writeError('You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"');
 
             return false;
         }
@@ -110,7 +110,7 @@ class GitHub
         } catch (TransportException $e) {
             if (in_array($e->getCode(), array(403, 401))) {
                 $this->io->writeError('<error>Invalid token provided.</error>');
-                $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"');
+                $this->io->writeError('You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"');
 
                 return false;
             }

+ 1 - 1
src/Composer/Util/GitLab.php

@@ -113,7 +113,7 @@ class GitLab
                     }
 
                     $this->io->writeError('You can also manually create a personal token at '.$scheme.'://'.$originUrl.'/profile/personal_access_tokens');
-                    $this->io->writeError('Add it using "composer config gitlab-token.'.$originUrl.' <token>"');
+                    $this->io->writeError('Add it using "composer config --global --auth gitlab-token.'.$originUrl.' <token>"');
 
                     continue;
                 }