From f1ea98b45a514a7e8d44d9f770b04075ab2407bd Mon Sep 17 00:00:00 2001 From: Eddie Jaoude Date: Mon, 6 Nov 2023 12:19:52 +0000 Subject: [PATCH] fix: www in custom base domain --- middleware.js | 5 +++-- pages/pricing.js | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/middleware.js b/middleware.js index 63ea6af7e4a..a3b20e7a170 100644 --- a/middleware.js +++ b/middleware.js @@ -28,9 +28,10 @@ export async function middleware(req) { /http:\/\/|https:\/\//, "", ); + const hostedDomains = [hostedDomain, `www.${hostedDomain}`]; // if custom domain + on root path - if (hostname !== hostedDomain && reqPathName === "/") { + if (!hostedDomains.includes(hostname) && reqPathName === "/") { console.log(`custom domain used: "${hostname}"`); let res; @@ -58,7 +59,7 @@ export async function middleware(req) { profile.settings.domain === hostname ) { console.log( - `custom domain matched "${hostname}" for username "${profile.username}" (protocol: "${protocol}"))`, + `custom domain matched "${hostname}" for username "${profile.username}" (protocol: "${protocol}")`, ); // if match found rewrite to custom domain and display profile page return NextResponse.rewrite( diff --git a/pages/pricing.js b/pages/pricing.js index 0b5d33340b9..b9eb7430572 100644 --- a/pages/pricing.js +++ b/pages/pricing.js @@ -185,9 +185,14 @@ export default function Premium({ user }) { tiers: { Free: false, Premium: true }, }, { - name: "Hide sign up button", + name: "Removed Button", description: - "Automatically removes the sign up button from your Profile", + 'Automatically removes the "Create your Profile" button from your Profile', + tiers: { Free: false, Premium: true }, + }, + { + name: "Custom Domain", + description: "Use your own domain for your Profile", tiers: { Free: false, Premium: true }, }, ],