Skip to content

Login works successfully but all other commands result in "Your API Token is invalid." #104

@AndrewMast

Description

@AndrewMast

Forge CLI Version

1.8.3

PHP Version

8.3.26

Description

Running forge login --token=XXX works and results in ==> Authenticated Successfully As [XXX], but all other commands result in Your API Token is invalid. for me.

I had just downloaded the forge cli yesterday. I logged in, and then I was able to add a SSH key, but for some reason after the SSH was added to the server, the command failed.

And now every command results in Your API Token is invalid., even after creating new API tokens, logging in multiple times, logging out, uninstalling and reinstalling forge-cli.

I was able to sort of figure out what is wrong:

  • When running forge login, my token is added to ~/.laravel-forge/config.json
  • When running any other command, the config file is updated with a key that is only 985 characters, but does not match my key.

Decoding the token shows a token with zero scopes ([]) and expired yesterday:

Image

I don't think I'll be doxxing myself, but I can provide the "token" that it always replaces my token with if needed.

Trying to edit the config file with my token always results in the token being replaced after every command run.

Steps To Reproduce

  1. Install forge-cli with composer global require laravel/forge-cli
  2. Log in with forge login --token=XXX
  3. Run any other forge command, i.e. forge server:list
Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions