Skip to content
Snippets Groups Projects

Resolve "Logging in while having an expired token shows an unnecessary error"

All threads resolved!
+ 1
4
@@ -59,10 +59,7 @@ var loginCmd = &cobra.Command{
// log out to remove active session in case an user is already logged in
if userToken != "" {
_, err := api.Logout(createContextWithAuthorization(), viper.GetString("controllerAPIEndpoint"), nbUserName)
if err != nil {
pterm.Error.Println("error logging out active user", err)
}
_, _ = api.Logout(createContextWithAuthorization(), viper.GetString("controllerAPIEndpoint"), nbUserName)
}
// TODO: maybe add credentials in context instead of context.TODO()
Loading