Surfaced during /simplify on #11.
`src/commands/whoami.rs:20-28` and `src/commands/module.rs:66-74` both do:
```rust
let creds = match credentials::load() {
Ok(c) => c,
Err(LoadError::NotFound) => {
return Err(anyhow!("not signed in. Run `mirrorstack login` to sign in."));
}
Err(e) => return Err(e.into()),
};
```
Extract a helper in `src/credentials/mod.rs` (or `src/commands/mod.rs`):
```rust
pub fn load_or_login_hint() -> anyhow::Result
```
Use from both call sites. Any future command that needs auth gets the same hint for free.
Why skipped from #11
That PR's scope was the three user-visible bugs (404 routing, missing pre-flight, plain-text UX). This is a small cross-file dedup — better as its own change so the diff stays readable.
Surfaced during /simplify on #11.
`src/commands/whoami.rs:20-28` and `src/commands/module.rs:66-74` both do:
```rust
let creds = match credentials::load() {
Ok(c) => c,
Err(LoadError::NotFound) => {
return Err(anyhow!("not signed in. Run `mirrorstack login` to sign in."));
}
Err(e) => return Err(e.into()),
};
```
Extract a helper in `src/credentials/mod.rs` (or `src/commands/mod.rs`):
```rust
pub fn load_or_login_hint() -> anyhow::Result
```
Use from both call sites. Any future command that needs auth gets the same hint for free.
Why skipped from #11
That PR's scope was the three user-visible bugs (404 routing, missing pre-flight, plain-text UX). This is a small cross-file dedup — better as its own change so the diff stays readable.