From e2f382c44dbd7a235aaa5640bfe924a627e36f16 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Sun, 23 Feb 2025 18:09:53 +0000 Subject: [PATCH 1/3] docs: document how to revoke `gh` OAuth tokens This documents how to revoke OAuth tokens generated by `gh`. This also adjusts some language to match the language used by GitHub.com: "invalidate" is now "revoke". --- pkg/cmd/auth/logout/logout.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/auth/logout/logout.go b/pkg/cmd/auth/logout/logout.go index ef978ebac..04307b6ad 100644 --- a/pkg/cmd/auth/logout/logout.go +++ b/pkg/cmd/auth/logout/logout.go @@ -39,7 +39,16 @@ func NewCmdLogout(f *cmdutil.Factory, runF func(*LogoutOptions) error) *cobra.Co for an account. The authentication configuration is only removed locally. - This command does not invalidate authentication tokens. + This command does not revoke authentication tokens. + + To revoke authentication tokens generated by the GitHub CLI: + + 1. Visit + 2. Select the "GitHub CLI" application + 3. Select "Revoke Access" + 4. Select "I understand, revoke access" + + For more information about revoking OAuth application tokens, see `), Example: heredoc.Doc(` # Select what host and account to log out of via a prompt From 736447cca45229c31715d2a9a039fda9d7ad51f6 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Sun, 23 Feb 2025 18:24:28 +0000 Subject: [PATCH 2/3] docs: warn about process revoking all tokens --- pkg/cmd/auth/logout/logout.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/auth/logout/logout.go b/pkg/cmd/auth/logout/logout.go index 04307b6ad..b54ddc81f 100644 --- a/pkg/cmd/auth/logout/logout.go +++ b/pkg/cmd/auth/logout/logout.go @@ -41,13 +41,16 @@ func NewCmdLogout(f *cmdutil.Factory, runF func(*LogoutOptions) error) *cobra.Co This command does not revoke authentication tokens. - To revoke authentication tokens generated by the GitHub CLI: + To revoke all authentication tokens generated by the GitHub CLI: 1. Visit 2. Select the "GitHub CLI" application 3. Select "Revoke Access" 4. Select "I understand, revoke access" + Note: this procedure will revoke all authentication tokens ever + generated by the GitHub CLI across all your devices. + For more information about revoking OAuth application tokens, see `), Example: heredoc.Doc(` From d68a4daa8c41d94f69914027051f7e747aedbbc7 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 24 Feb 2025 14:12:19 -0700 Subject: [PATCH 3/3] docs: OAuth doc link moves to newline Co-authored-by: Andy Feller --- pkg/cmd/auth/logout/logout.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/auth/logout/logout.go b/pkg/cmd/auth/logout/logout.go index b54ddc81f..dd908a62d 100644 --- a/pkg/cmd/auth/logout/logout.go +++ b/pkg/cmd/auth/logout/logout.go @@ -51,7 +51,8 @@ func NewCmdLogout(f *cmdutil.Factory, runF func(*LogoutOptions) error) *cobra.Co Note: this procedure will revoke all authentication tokens ever generated by the GitHub CLI across all your devices. - For more information about revoking OAuth application tokens, see + For more information about revoking OAuth application tokens, see: + `), Example: heredoc.Doc(` # Select what host and account to log out of via a prompt