Skip to content

[Bug]: --auth option not usable because ensureExposeSetup() #459

@jvjc

Description

@jvjc

System architecture

Mac, Intel (x86)

PHP Version

PHP 8.3.20 (cli) (built: Jun 11 2025 18:01:02) (NTS)

Bug description

Hi 👋

In the current release of Expose 3.0.3 the share command’s --auth flag seems broken.

Code reference: ShareCommand::handle() calls ensureExposeSetup() before reading the --auth option.

That means:

  1. ensureExposeSetup() aborts if config('expose.auth_token') is empty.
  2. Even if I pass --auth=MYTOKEN on the CLI, the command exits with:
    "No authentication token set."

Expected behavior:

  • Passing --auth should allow running Expose without needing a config file.
  • ensureExposeSetup() should probably run after merging CLI options and config.

Thanks for looking into it!

Steps to reproduce

expose share http://127.0.0.1:5500 --auth=MYTOKEN
> Expose
  No authentication token set.  

### Relevant log output

```shell

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions