diff --git a/cli/cli_click.go b/cli/cli_click.go index 9a98c0c5..9496564a 100644 --- a/cli/cli_click.go +++ b/cli/cli_click.go @@ -54,19 +54,21 @@ func (c *cmd) Click(ctx *cli.Context) (err error) { return formatError(err) } - if url.Scheme == "nordvpn-sl" && url.Host == "claim-online-purchase" { - resp, err := c.client.ClaimOnlinePurchase(context.Background(), &pb.Empty{}) - if err != nil { - return formatError(err) - } + if url.Scheme == "nordvpn" { + if url.Host == "claim-online-purchase" { + resp, err := c.client.ClaimOnlinePurchase(context.Background(), &pb.Empty{}) + if err != nil { + return formatError(err) + } + + if !resp.Success { + return errors.New(ClaimOnlinePurchaseFailure) + } - if !resp.Success { - return errors.New(ClaimOnlinePurchaseFailure) + color.Green(ClaimOnlinePurchaseSuccess) + return nil } - color.Green(ClaimOnlinePurchaseSuccess) - return nil - } else if url.Scheme == "nordvpn" { // if arg is given // run the same as: login --callback %arg if err := c.oauth2(ctx); err != nil { diff --git a/client/messages.go b/client/messages.go index 320a2fb1..c1b870db 100644 --- a/client/messages.go +++ b/client/messages.go @@ -17,8 +17,8 @@ const ( MsgTryAgain = "We're having trouble reaching our servers. Please try again later. If the issue persists, please contact our customer support." UFWDisabledMessage = "The active UFW firewall on your system prevents us from setting up our firewall properly. We have disabled UFW for the duration of your VPN connection and enabled our firewall to ensure your online security. Your custom UFW rules are imported to our firewall ruleset." - SubscriptionURL = "https://my.nordaccount.com/plans/?product_group=nordvpn&login_target=nordvpn&utm_source=linux&utm_medium=app&utm_campaign=desktop-app&redirect_uri=nordvpn-sl://claim-online-purchase" - SubscriptionURLLogin = "https://my.nordaccount.com/plans/?product_group=nordvpn&login_target=nordvpn&utm_source=linux&utm_medium=app&utm_campaign=desktop-app&trusted_pass_token=%s&owner_id=%s&redirect_uri=nordvpn-sl://claim-online-purchase" + SubscriptionURL = "https://my.nordaccount.com/plans/?product_group=nordvpn&login_target=nordvpn&utm_source=linux&utm_medium=app&utm_campaign=desktop-app&redirect_uri=nordvpn://claim-online-purchase" + SubscriptionURLLogin = "https://my.nordaccount.com/plans/?product_group=nordvpn&login_target=nordvpn&utm_source=linux&utm_medium=app&utm_campaign=desktop-app&trusted_pass_token=%s&owner_id=%s&redirect_uri=nordvpn://claim-online-purchase" SubscriptionDedicatedIPURL = "https://my.nordaccount.com/dashboard/nordvpn/dedicatedip/?product_group=nordvpn&utm_source=linux&utm_medium=in-app&utm_campaign=desktop-app" SubscriptionDedicatedIPURLLogin = "https://my.nordaccount.com/dashboard/nordvpn/dedicatedip/?product_group=nordvpn&utm_source=linux&utm_medium=in-app&utm_campaign=desktop-app&trusted_pass_token=%s&owner_id=%s" ) diff --git a/contrib/desktop/nordvpn.desktop b/contrib/desktop/nordvpn.desktop index 45de7503..90820fc1 100644 --- a/contrib/desktop/nordvpn.desktop +++ b/contrib/desktop/nordvpn.desktop @@ -4,6 +4,6 @@ Type=Application Name=NordVPN Comment=The best online VPN service for speed and security. Icon=nordvpn -MimeType=x-scheme-handler/nordvpn;x-scheme-handler/nordvpn-sl +MimeType=x-scheme-handler/nordvpn Exec=nordvpn click %u Terminal=true