From 9e0bc6555ce042cea05a545a6fd6619a69e93816 Mon Sep 17 00:00:00 2001 From: Brian Lovin Date: Fri, 25 Jan 2019 12:05:17 -0800 Subject: [PATCH] Fix login redirects --- api/utils/is-spectrum-url.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/utils/is-spectrum-url.js b/api/utils/is-spectrum-url.js index 3235cb3569..b1c2dcb194 100644 --- a/api/utils/is-spectrum-url.js +++ b/api/utils/is-spectrum-url.js @@ -16,7 +16,8 @@ export default (url: string): boolean => { const { hostname, protocol } = new URL(url); // hostname might be spectrum.chat or subdomain.spectrum.chat, so we use .endsWith // We don't just check .contains because otherwise folks could make spectrum.chat.mydomain.com - const IS_SPECTRUM_URL = hostname.endsWith('.spectrum.chat'); + const IS_SPECTRUM_URL = + hostname === 'spectrum.chat' || hostname === 'alpha.spectrum.chat'; const IS_LOCALHOST = hostname === 'localhost'; const IS_HTTP = protocol === 'https:' || protocol === 'http:'; // Make sure the passed redirect URL is a spectrum.chat one or (in development) localhost