From 3be9c620fc7e9d7616124b5bcdaafa3d509ae1ff Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 7 Mar 2024 14:52:17 +0100 Subject: Client + Server: Add a way to obtain the cached profiles list --- client/client.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'client/client.go') diff --git a/client/client.go b/client/client.go index f6c8279..127c790 100644 --- a/client/client.go +++ b/client/client.go @@ -70,16 +70,11 @@ func (c *Client) GettingConfig() error { // It is called when a profile is invalid // Here we call the AskProfile transition func (c *Client) InvalidProfile(ctx context.Context, srv *server.Server) (string, error) { - // TODO: should this have profiles as a parameter ck := cookie.NewWithContext(ctx) - - prfs, err := srv.Profiles(ctx) + prfs, err := srv.Profiles() if err != nil { return "", err } - if !c.SupportsWireguard { - prfs = prfs.FilterWireGuard() - } // we are guaranteed to have profiles > 0 (even after filtering) // because internally this callback is only triggered if there is a choice to make @@ -87,7 +82,7 @@ func (c *Client) InvalidProfile(ctx context.Context, srv *server.Server) (string go func() { err := c.FSM.GoTransitionRequired(StateAskProfile, &srvtypes.RequiredAskTransition{ C: ck, - Data: prfs.Public(), + Data: prfs, }) if err != nil { errChan <- err -- cgit v1.2.3