Skip to content

Commit

Permalink
feat(nordvpn): add access token warning if used as wireguard private key
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Nov 8, 2023
1 parent de19649 commit 8318be3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/configuration/settings/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8318be3

Please sign in to comment.