Skip to content

Commit 5b7a14b

Browse files
authored
[auth] add --show-tokens to devbox auth whoami (#1766)
## Summary Exposing the tokens for easier debugging, when needed ## How was it tested? `devbox auth whoami --show-tokens`
1 parent c2ab2ca commit 5b7a14b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

internal/boxcli/auth.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ func logoutCmd() *cobra.Command {
7575
return cmd
7676
}
7777

78+
type whoAmICmdFlags struct {
79+
showTokens bool
80+
}
81+
7882
func whoAmICmd() *cobra.Command {
83+
flags := &whoAmICmdFlags{}
7984
cmd := &cobra.Command{
8085
Use: "whoami",
8186
Short: "Show the current user",
@@ -90,10 +95,17 @@ func whoAmICmd() *cobra.Command {
9095
return err
9196
}
9297
return box.UninitializedSecrets(cmd.Context()).
93-
WhoAmI(cmd.Context(), cmd.OutOrStdout(), false)
98+
WhoAmI(cmd.Context(), cmd.OutOrStdout(), flags.showTokens)
9499
},
95100
}
96101

102+
cmd.Flags().BoolVar(
103+
&flags.showTokens,
104+
"show-tokens",
105+
false,
106+
"Show the access, id, and refresh tokens",
107+
)
108+
97109
return cmd
98110
}
99111

0 commit comments

Comments
 (0)