@@ -18,6 +18,8 @@ import (
1818 "context"
1919 "fmt"
2020
21+ "github.com/slackapi/slack-cli/internal/config"
22+ "github.com/slackapi/slack-cli/internal/experiment"
2123 "github.com/slackapi/slack-cli/internal/iostreams"
2224 authpkg "github.com/slackapi/slack-cli/internal/pkg/auth"
2325 "github.com/slackapi/slack-cli/internal/shared"
@@ -109,7 +111,7 @@ func RunLoginCommand(clients *shared.ClientFactory, cmd *cobra.Command) (types.S
109111 return types.SlackAuth {}, err
110112 }
111113 if selectedAuth .Token != "" {
112- printAuthSuccess (cmd , clients .IO , credentialsPath , selectedAuth .Token )
114+ printAuthSuccess (cmd , clients .Config , clients . IO , credentialsPath , selectedAuth .Token )
113115 printAuthNextSteps (ctx , clients )
114116 }
115117 return selectedAuth , err
@@ -119,14 +121,14 @@ func RunLoginCommand(clients *shared.ClientFactory, cmd *cobra.Command) (types.S
119121 if err != nil {
120122 return types.SlackAuth {}, err
121123 } else {
122- printAuthSuccess (cmd , clients .IO , credentialsPath , selectedAuth .Token )
124+ printAuthSuccess (cmd , clients .Config , clients . IO , credentialsPath , selectedAuth .Token )
123125 printAuthNextSteps (ctx , clients )
124126 }
125127
126128 return selectedAuth , nil
127129}
128130
129- func printAuthSuccess (cmd * cobra.Command , IO iostreams.IOStreamer , credentialsPath string , token string ) {
131+ func printAuthSuccess (cmd * cobra.Command , config * config. Config , IO iostreams.IOStreamer , credentialsPath string , token string ) {
130132 ctx := cmd .Context ()
131133
132134 var secondaryLog string
@@ -136,7 +138,13 @@ func printAuthSuccess(cmd *cobra.Command, IO iostreams.IOStreamer, credentialsPa
136138 secondaryLog = fmt .Sprintf ("Service token:\n \n %s\n \n Make sure to copy the token now and save it safely." , token )
137139 }
138140
139- IO .PrintInfo (ctx , false , "\n %s" , style .Sectionf (style.TextSection {
141+ // The legacy prompt leaves no blank line before the success message, so
142+ // print one here. The Charm-based prompt already handles spacing.
143+ if ! config .WithExperimentOn (experiment .Charm ) {
144+ IO .PrintInfo (ctx , false , "" )
145+ }
146+
147+ IO .PrintInfo (ctx , false , "%s" , style .Sectionf (style.TextSection {
140148 Emoji : "key" ,
141149 Text : "You've successfully authenticated!" ,
142150 Secondary : []string {secondaryLog },
@@ -148,15 +156,15 @@ func printAuthSuccess(cmd *cobra.Command, IO iostreams.IOStreamer, credentialsPa
148156func printAuthNextSteps (ctx context.Context , clients * shared.ClientFactory ) {
149157 project , _ := clients .SDKConfig .Exists ()
150158 if ! project {
151- clients .IO .PrintInfo (ctx , false , style .Sectionf (style.TextSection {
159+ clients .IO .PrintInfo (ctx , false , "%s" , style .Sectionf (style.TextSection {
152160 Emoji : "bulb" ,
153161 Text : fmt .Sprintf ("Get started by creating a new app with %s" , style .Commandf ("create my-app" , true )),
154162 Secondary : []string {
155163 fmt .Sprintf ("Explore the details of available commands with %s" , style .Commandf ("help" , false )),
156164 },
157165 }))
158166 } else {
159- clients .IO .PrintInfo (ctx , false , style .Sectionf (style.TextSection {
167+ clients .IO .PrintInfo (ctx , false , "%s" , style .Sectionf (style.TextSection {
160168 Emoji : "bulb" ,
161169 Text : fmt .Sprintf ("Review existing installations of the app with %s" , style .Commandf ("app list" , false )),
162170 Secondary : []string {
0 commit comments