From 2b143ebeebecaf9939dd1de8aa37d135a25d3093 Mon Sep 17 00:00:00 2001 From: Maxime Le Conte des Floris Date: Tue, 10 Apr 2018 00:09:58 +0200 Subject: [PATCH] fix: allow trailing slash in instance name (#52) Fix #31: allow trailing slash in instance name --- routes/_actions/addInstance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/_actions/addInstance.js b/routes/_actions/addInstance.js index fd5a1ee..9fabce8 100644 --- a/routes/_actions/addInstance.js +++ b/routes/_actions/addInstance.js @@ -13,7 +13,7 @@ const REDIRECT_URI = (typeof location !== 'undefined' async function redirectToOauth () { let instanceName = store.get('instanceNameInSearch') let loggedInInstances = store.get('loggedInInstances') - instanceName = instanceName.replace(/^https?:\/\//, '').replace('/$', '').toLowerCase() + instanceName = instanceName.replace(/^https?:\/\//, '').replace(/\/$/, '').replace('/$', '').toLowerCase() if (Object.keys(loggedInInstances).includes(instanceName)) { store.set({logInToInstanceError: `You've already logged in to ${instanceName}`}) return