fix: allow trailing slash in instance name (#52)

Fix #31: allow trailing slash in instance name
This commit is contained in:
Maxime Le Conte des Floris 2018-04-10 00:09:58 +02:00 committed by Nolan Lawson
parent 35eac4a314
commit 2b143ebeeb
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ const REDIRECT_URI = (typeof location !== 'undefined'
async function redirectToOauth () { async function redirectToOauth () {
let instanceName = store.get('instanceNameInSearch') let instanceName = store.get('instanceNameInSearch')
let loggedInInstances = store.get('loggedInInstances') let loggedInInstances = store.get('loggedInInstances')
instanceName = instanceName.replace(/^https?:\/\//, '').replace('/$', '').toLowerCase() instanceName = instanceName.replace(/^https?:\/\//, '').replace(/\/$/, '').replace('/$', '').toLowerCase()
if (Object.keys(loggedInInstances).includes(instanceName)) { if (Object.keys(loggedInInstances).includes(instanceName)) {
store.set({logInToInstanceError: `You've already logged in to ${instanceName}`}) store.set({logInToInstanceError: `You've already logged in to ${instanceName}`})
return return