diff --git a/internal/cli/try_login.go b/internal/cli/try_login.go index cf9eee731..ca4715ca7 100644 --- a/internal/cli/try_login.go +++ b/internal/cli/try_login.go @@ -26,7 +26,6 @@ const ( func tryLoginCmd(cli *cli) *cobra.Command { var clientID string var connectionName string - var reveal bool cmd := &cobra.Command{ Use: "try-login", @@ -114,7 +113,7 @@ Launch a browser to try out your universal login box for the given client. return err } - cli.renderer.TryLogin(userInfo, tokenResponse, reveal) + cli.renderer.TryLogin(userInfo, tokenResponse) return nil }, } @@ -122,7 +121,6 @@ Launch a browser to try out your universal login box for the given client. cmd.SetUsageTemplate(resourceUsageTemplate()) cmd.Flags().StringVarP(&clientID, "client-id", "c", "", "Client ID for which to test login.") cmd.Flags().StringVarP(&connectionName, "connection", "", "", "Connection to test during login.") - cmd.Flags().BoolVarP(&reveal, "reveal", "r", false, "⚠️ Reveal tokens after successful login.") return cmd } diff --git a/internal/display/try_login.go b/internal/display/try_login.go index 8b83745e6..4f2f90125 100644 --- a/internal/display/try_login.go +++ b/internal/display/try_login.go @@ -26,15 +26,9 @@ func isNotZero(v interface{}) bool { return v != reflect.Zero(t).Interface() } -func (r *Renderer) TryLogin(u *auth.UserInfo, t *auth.TokenResponse, reveal bool) { +func (r *Renderer) TryLogin(u *auth.UserInfo, t *auth.TokenResponse) { r.Heading(ansi.Bold(auth0.StringValue(u.Sub)), "/userinfo\n") - if !reveal { - t.AccessToken = "[REDACTED]" - t.RefreshToken = "[REDACTED]" - t.IDToken = "[REDACTED]" - } - switch r.Format { case OutputFormatJSON: out := &userInfoAndTokens{UserInfo: u, Tokens: t} @@ -103,23 +97,14 @@ func (r *Renderer) TryLogin(u *auth.UserInfo, t *auth.TokenResponse, reveal bool rows = append(rows, []string{ansi.Faint("UpdatedAt"), auth0.TimeValue(u.UpdatedAt).Format(time.RFC3339)}) } if isNotZero(t.AccessToken) { - if !reveal { - t.AccessToken = ansi.Faint(t.AccessToken) - } rows = append(rows, []string{ansi.Faint("AccessToken"), t.AccessToken}) } if isNotZero(t.RefreshToken) { - if !reveal { - t.RefreshToken = ansi.Faint(t.RefreshToken) - } rows = append(rows, []string{ansi.Faint("RefreshToken"), t.RefreshToken}) } // TODO: This is a long string and it messes up formatting when printed // to the table, so need to come back to this one and fix it later. // if isNotZero(t.IDToken) { - // if !reveal { - // t.IDToken = ansi.Faint(t.IDToken) - // } // rows = append(rows, []string{ansi.Faint("IDToken"), t.IDToken}) // } if isNotZero(t.TokenType) {