mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-05 08:54:11 -04:00
[client] Check if login is required on foreground mode (#5295)
This commit is contained in:
@@ -282,13 +282,9 @@ func foregroundLogin(ctx context.Context, cmd *cobra.Command, config *profileman
|
|||||||
}
|
}
|
||||||
defer authClient.Close()
|
defer authClient.Close()
|
||||||
|
|
||||||
needsLogin := false
|
needsLogin, err := authClient.IsLoginRequired(ctx)
|
||||||
|
if err != nil {
|
||||||
err, isAuthError := authClient.Login(ctx, "", "")
|
return fmt.Errorf("check login required: %v", err)
|
||||||
if isAuthError {
|
|
||||||
needsLogin = true
|
|
||||||
} else if err != nil {
|
|
||||||
return fmt.Errorf("login check failed: %v", err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jwtToken := ""
|
jwtToken := ""
|
||||||
|
|||||||
Reference in New Issue
Block a user