exposedev / exposedev/expose

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

Open
#459 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
4.6k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

### 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

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

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.