Fredric Silberberg
a656271f26
Print gh auth refresh for 401 returns
...
`gh auth refresh` exists to make it simpler for users to refresh their tokens on expiration/scope mismatch, but help messages only suggest using it in limited scenarios, and not in a common case of a token expiring and the user receiving a 401 error. Now, the auth flow will detect this case, and for refreshable tokens (namely, tokens created by logging in with `gh auth login` in the first place), it will suggest using `gh auth refresh` for these cases.
2026-04-20 12:07:14 -06:00
Babak K. Shandiz
38d6a83e35
test(auth status): correctly replace JSON-escaped paths
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-25 10:51:47 +01:00
Babak K. Shandiz
e31136a677
docs(auth status): explain --json will always exit with zero
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-23 15:42:25 +01:00
Babak K. Shandiz
5fddcef0a8
fix(auth status): return JSON entries under hosts
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-23 15:24:37 +01:00
Benjamin Levesque
914531e6f1
fixup! examples
2025-09-16 23:07:11 +02:00
Benjamin Levesque
4449af614c
fix error missing in json output
2025-09-16 23:00:41 +02:00
Benjamin Levesque
5bb76e832b
examples
2025-09-16 22:00:07 +02:00
Benjamin Levesque
3cdd359987
remove showToken from authEntry
2025-09-16 21:57:28 +02:00
Benjamin Levesque
e2df8ac1cc
address copilot comment on parameter order
2025-09-13 22:33:27 +02:00
Benjamin Levesque
5ae0410bd2
add examples
2025-09-13 22:25:20 +02:00
Benjamin Levesque
a69f7a6b53
simplify exporter usage
2025-09-13 22:14:59 +02:00
Benjamin Levesque
5abb467e69
remove includeScope
2025-09-13 21:50:06 +02:00
Benjamin Levesque
54bf8432f6
do not mutate opts.ShowToken
2025-09-13 21:35:02 +02:00
Benjamin Levesque
60088e0e7d
move displayToken to String method
2025-09-13 21:30:20 +02:00
Benjamin Levesque
b38e12ef61
move flag validation to RunE
2025-09-13 21:30:19 +02:00
Benjamin Levesque
45ecc5ece9
introduce AddJSONFlagsWithoutShorthand
2025-08-31 17:56:52 +02:00
Benjamin Levesque
78675e73e1
fix show token when using json
2025-08-20 21:01:31 +02:00
Benjamin Levesque
48bc79a291
fix exit code
2025-08-20 20:26:27 +02:00
Benjamin Levesque
085f31fed8
revert showToken change
2025-08-20 20:07:57 +02:00
Benjamin Levesque
c937e0275d
mutually exclusive flags
2025-08-20 20:02:41 +02:00
Benjamin Levesque
faa0e2c26b
flag duplicate check
2025-08-20 20:02:00 +02:00
Benjamin Levesque
6e6c09e6b1
add ExpectCommandToSupportJSONFields
2025-08-20 19:36:09 +02:00
Benjamin Levesque
3d02e248c0
do not export authState
2025-08-20 17:50:29 +02:00
Benjamin Levesque
96755eec83
handle -t conflict
2025-08-20 09:05:20 +02:00
Benjamin Levesque
3ffe199ef3
do not fetch scope if not necessary
2025-08-20 01:04:09 +02:00
Benjamin Levesque
8b553d66cc
json flags
2025-08-20 00:27:31 +02:00
Benjamin Levesque
fd19da8e55
auth state enum
2025-08-19 23:43:22 +02:00
Benjamin Levesque
0091384495
Refactor entry to a single type
2025-08-19 22:54:31 +02:00
Benjamin Levesque
c5fc7e3ffb
Fix missing assertions
2025-08-19 22:37:25 +02:00
Andy Feller
03c34e71f9
Expand active test cases
2024-08-30 10:57:51 -04:00
Velmurugan
1eecfd4530
Added --active flag to the gh auth status command
2024-08-24 16:24:51 +05:30
Stausssi
e7606363fb
document exit code behavior
2024-07-22 20:36:22 +02:00
Simon
0a3a12839d
Exit with 1 on authentication failure
2024-07-22 20:22:42 +02:00
William Martin
07e0ff7127
Fix repo fork to use remote protocol if none configured
2024-05-10 10:48:36 +02:00
William Martin
1d38230675
Move config interfaces into gh package ( #9060 )
2024-05-10 10:39:36 +02:00
William Martin
4ca098b0c9
Adjust short and long to be the same
2024-05-01 14:17:08 +02:00
William Martin
5a5b04d132
Document relationship between host and active account
2024-05-01 11:14:00 +02:00
Josh Soref
6ff355049c
Improve discovery of gh auth status
2024-03-18 12:09:27 -04:00
Sam Coe
80fc413592
Polish auth status timeout error message
2023-12-06 14:06:28 +01:00
Sam Coe
024cb939af
Rename authCfg.Token to authCfg.ActiveToken and authCfg.SetToken to authCfg.SetActiveToken
2023-12-06 14:06:28 +01:00
Sam Coe
1a3392a379
Rename authCfg.User to authCfg.ActiveUser
2023-12-06 14:06:28 +01:00
Sam Coe
8cdbc1a8ca
Refactor authCfg.UsersForHost to not return an error
2023-12-06 14:06:28 +01:00
Sam Coe
587007a562
Additional auth status tests
2023-12-06 14:06:28 +01:00
William Martin
15ba536317
Ensure subtests use the right t during setup
2023-12-06 14:06:28 +01:00
William Martin
c9a6b7cc00
Always mock the keyring in NewIsolatedTestConfig
2023-12-06 14:06:28 +01:00
Sam Coe
e806664ef7
New UX for auth status
2023-12-06 14:06:28 +01:00
Sam Coe
760dc91faa
Include environment variable users in auth status output
2023-12-06 14:06:28 +01:00
William Martin
b2997cc7bd
Handle multi account golden path in auth status
2023-12-06 14:06:28 +01:00
William Martin
e4ed4041cd
Use auth config and only print stdout in status
2023-12-06 14:06:28 +01:00
William Martin
5d10beb60a
Use config to look up user for status
2023-12-06 14:06:28 +01:00