Skip to content

Commit

Permalink
Remove port forwarding menu link and route from client area
Browse files Browse the repository at this point in the history
  • Loading branch information
Natanael Rodriguez Ramos authored and Natanael Rodriguez Ramos committed Sep 28, 2023
1 parent 4fc4628 commit 783f004
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/themes/ivpn-v3/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let products = {
name: 'IVPN Pro',
capabilities: {
hasWireGuard: true,
hasPortForwarding: true,
hasPortForwarding: false,
},
prices: [
{ id: 'pro-1week', name: '1 Week', price: 4 },
Expand Down
9 changes: 0 additions & 9 deletions src/themes/ivpn-v3/assets/js/components/AccountInfo.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<template>
<div>
<div class="note" v-if="
account.is_active &&
account.product.capabilities.has_port_forwarding &&
isPortForwardingEnabled
">
<p>Note: port forwarding is being phased out from the IVPN service. Read our <a href="https://www.ivpn.net/blog/gradual-removal-of-port-forwarding/">blog post</a> about this change, and <a href="https://www.ivpn.net/contactus/">contact us</a> if you have any questions.</p>
</div>
<div class="account-id-section">
<div class="details">
<label class="header">Account ID</label>
Expand Down Expand Up @@ -58,11 +51,9 @@ export default {
this.qrCode = qr.createSvgTag(3);
},
mounted() {
this.$store.dispatch("portForwarding/load");
},
computed: {
...mapState({
isPortForwardingEnabled: (state) => state.portForwarding.isEnabled,
}),
},
methods: {
Expand Down
23 changes: 3 additions & 20 deletions src/themes/ivpn-v3/assets/js/components/AccountMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
>IVPN Account</router-link
>
</li>
<li v-id="allowPortForwarding" :class="{ 'is-active': isWireGuardRoute() }">
<li :class="{ 'is-active': isWireGuardRoute() }">
<router-link :to="{ name: 'wireguard' }"
>WireGuard</router-link
>
</li>
<li v-if="allowPortForwarding" :class="{ 'is-active': isPortWordwarding() }" tag="li">
<router-link :to="{ name: 'port-forwarding' }"
>Port Forwarding</router-link
>
</li>
<li class="expand"></li>
<li>
<router-link
Expand All @@ -42,33 +37,21 @@ export default {
return this.$route.path;
},
shouldDisplay() {
return ["account", "port-forwarding", "wireguard", "wireguard-config"].includes(
return ["account", "wireguard", "wireguard-config"].includes(
this.$route.name
);
},
allowPortForwarding(){
//Disable port forwarding starting from 29th June 2023
if( new Date(this.account.created_at).setHours(0, 0, 0, 0) >= new Date('2023-06-29').setHours(0, 0, 0, 0) ){
return false;
} else {
return true;
}
}
},
methods: {
isAccountRoute() {
return (
this.currentRouteName.startsWith("/account") &&
!this.isWireGuardRoute() &&
!this.isPortWordwarding()
!this.isWireGuardRoute()
);
},
isWireGuardRoute() {
return this.currentRouteName.startsWith("/account/wireguard");
},
isPortWordwarding() {
return this.currentRouteName.startsWith("/account/port-forwarding");
},
},
};
</script>
Expand Down
9 changes: 0 additions & 9 deletions src/themes/ivpn-v3/assets/js/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import AddFundsGiftCard from '@/views/Account/AddFunds/GiftCard.vue'

import WireguardView from '@/views/Account/Wireguard.vue'
import WireguardConfigView from '@/views/Account/WireguardConfig.vue'
import PortForwardingView from '@/views/Account/PortForwarding.vue'
import Settings from '@/views/Account/Settings.vue'
import SettingsAuthentication from '@/views/Account/Settings/Authentication.vue'
import SettingsBilling from '@/views/Account/Settings/Billing.vue'
Expand Down Expand Up @@ -280,14 +279,6 @@ const routes = [
title: 'IVPN Account - WireGuard Configuration',
}
},
{
path: '/account/port-forwarding',
name: 'port-forwarding',
component: PortForwardingView,
meta: {
title: 'IVPN Account - Port Forwarding',
}
},
{
path: '/404',
name: '404',
Expand Down
2 changes: 0 additions & 2 deletions src/themes/ivpn-v3/assets/js/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Vuex from "vuex"
import auth from "./module_auth.js"
import popup from "./module_popup.js"
import wireguard from "./module_wireguard.js"
import portForwarding from "./module_port_forwarding.js"
import payments from "./module_payments.js"
import product from "./module_product.js"
import deleteAccount from "./module_delete_account.js"
Expand All @@ -18,7 +17,6 @@ export default new Vuex.Store({
popup,
payments,
wireguard,
portForwarding,
deleteAccount,
product,
braintree,
Expand Down

0 comments on commit 783f004

Please sign in to comment.