diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 15:03:37 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 15:06:02 +0000 |
| commit | 09c3ae91830bd9c7543b401b19f8c65a15205d32 (patch) | |
| tree | 3c7505301c9868cd421fbf0097ed946b9f4b9088 /src/lib/login/mod.rs | |
| parent | 37244449d6d0d58bb639f181bd15092de1acaaee (diff) | |
fix(whoami): detect and fall back to system git config for nostr login
Add GitSystem to SignerInfoSource so credentials stored in the system
git config (/etc/gitconfig) are included in the priority fallback chain
(local > global > system) and shown as a separate level in whoami output.
Diffstat (limited to 'src/lib/login/mod.rs')
| -rw-r--r-- | src/lib/login/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/login/mod.rs b/src/lib/login/mod.rs index 47847c3..938cec4 100644 --- a/src/lib/login/mod.rs +++ b/src/lib/login/mod.rs | |||
| @@ -65,6 +65,7 @@ pub enum SignerInfo { | |||
| 65 | pub enum SignerInfoSource { | 65 | pub enum SignerInfoSource { |
| 66 | GitLocal, | 66 | GitLocal, |
| 67 | GitGlobal, | 67 | GitGlobal, |
| 68 | GitSystem, | ||
| 68 | CommandLineArguments, | 69 | CommandLineArguments, |
| 69 | } | 70 | } |
| 70 | 71 | ||
| @@ -91,6 +92,7 @@ fn print_logged_in_as( | |||
| 91 | SignerInfoSource::CommandLineArguments => " via cli arguments", | 92 | SignerInfoSource::CommandLineArguments => " via cli arguments", |
| 92 | SignerInfoSource::GitLocal => " to local repository", | 93 | SignerInfoSource::GitLocal => " to local repository", |
| 93 | SignerInfoSource::GitGlobal => "", | 94 | SignerInfoSource::GitGlobal => "", |
| 95 | SignerInfoSource::GitSystem => " via system git config", | ||
| 94 | } | 96 | } |
| 95 | ); | 97 | ); |
| 96 | Ok(()) | 98 | Ok(()) |