svenluijten / forge-cli

🔥 A command line utility to interact with your Laravel Forge servers, sites, and more.
https://svenluijten.com
MIT License
64 stars 14 forks source link

"Unauthorized" error after successfully setting API key #17

Closed j-greig closed 6 years ago

j-greig commented 6 years ago

Your API key has successfully been set.

But then...

$ forge list:servers

In MakesHttpRequests.php line 101:

Unauthorized

More detail:

Exception trace: Themsaid\Forge\Forge->handleRequestError() at /Users/James/.composer/vendor/themsaid/forge-sdk/src/MakesHttpRequests.php:75 Themsaid\Forge\Forge->request() at /Users/James/.composer/vendor/themsaid/forge-sdk/src/MakesHttpRequests.php:21 Themsaid\Forge\Forge->get() at /Users/James/.composer/vendor/themsaid/forge-sdk/src/Actions/ManagesCredentials.php:17 Themsaid\Forge\Forge->credentials() at /Users/James/.composer/vendor/sven/forge-cli/src/Commands/Credentials.php:27 Sven\ForgeCLI\Commands\Credentials->execute() at /Users/James/.composer/vendor/symfony/console/Command/Command.php:252 Symfony\Component\Console\Command\Command->run() at /Users/James/.composer/vendor/symfony/console/Application.php:832 Symfony\Component\Console\Application->doRunCommand() at /Users/James/.composer/vendor/symfony/console/Application.php:210 Symfony\Component\Console\Application->doRun() at /Users/James/.composer/vendor/symfony/console/Application.php:122 Symfony\Component\Console\Application->run() at /Users/James/.composer/vendor/sven/forge-cli/bin/forge:9

PHP

$ php -v
PHP 7.1.12 (cli) (built: Dec  2 2017 12:14:16) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
$ which php
/usr/local/opt/php@7.1/bin/php
j-greig commented 6 years ago

Running forge credentials gives the same error.

svenluijten commented 6 years ago

Interesting! I have a feeling this may be related to #13. Can you manually enter your API key in ~/forge.json, and see if that fixes the issue?

j-greig commented 6 years ago

Yes! 👌 🎉