1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-11 09:45:24 +01:00

lowercase instance name when inputting

This commit is contained in:
Nolan Lawson 2018-01-27 17:41:18 -08:00
parent 5a55506204
commit bda07e3f22

View File

@ -12,7 +12,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('/$', '')
instanceName = instanceName.replace(/^https?:\/\//, '').replace('/$', '').toLowerCase()
if (Object.keys(loggedInInstances).includes(instanceName)) {
store.set({logInToInstanceError: `You've already logged in to ${instanceName}`})
return