From 8318be3159ec144bbaaeb5417231773f0b234c38 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 8 Nov 2023 09:57:42 +0000 Subject: [PATCH] feat(nordvpn): add access token warning if used as wireguard private key --- internal/configuration/settings/wireguard.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/configuration/settings/wireguard.go b/internal/configuration/settings/wireguard.go index fdc99ea0d..8d1e47b69 100644 --- a/internal/configuration/settings/wireguard.go +++ b/internal/configuration/settings/wireguard.go @@ -70,7 +70,12 @@ func (w Wireguard) validate(vpnProvider string, ipv6Supported bool) (err error) } _, err = wgtypes.ParseKey(*w.PrivateKey) if err != nil { - return fmt.Errorf("private key is not valid: %w", err) + err = fmt.Errorf("private key is not valid: %w", err) + if vpnProvider == providers.Nordvpn && + err.Error() == "wgtypes: incorrect key size: 48" { + err = fmt.Errorf("%w - you might be using your access token instead of the Wireguard private key", err) + } + return err } if vpnProvider == providers.Airvpn {