From 8f044e19c8ec48f98ee20b076dfb89e6299766a9 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 7 Oct 2019 07:15:19 -0700 Subject: [PATCH] fix: remove basic login mode for now (#1554) * fix: remove basic login mode for now As described in #1552 I do not have a lot of faith in this feature, so maybe it should just be removed for now until a later release. * fixup * fixup * fixup --- src/routes/_actions/addInstance.js | 26 +------- src/routes/_pages/settings/instances/add.html | 63 +------------------ tests/spec/002-login-spec.js | 16 +---- 3 files changed, 9 insertions(+), 96 deletions(-) diff --git a/src/routes/_actions/addInstance.js b/src/routes/_actions/addInstance.js index 1db0069b..1cf0eeae 100644 --- a/src/routes/_actions/addInstance.js +++ b/src/routes/_actions/addInstance.js @@ -15,8 +15,7 @@ function createKnownError (message) { } function getRedirectUri () { - const { copyPasteMode } = store.get() - return copyPasteMode ? 'urn:ietf:wg:oauth:2.0:oob' : `${location.origin}/settings/instances/add` + return `${location.origin}/settings/instances/add` } async function redirectToOauth () { @@ -45,13 +44,8 @@ async function redirectToOauth () { redirectUri ) // setTimeout to allow the browser to *actually* save the localStorage data (fixes Safari bug apparently) - const { copyPasteMode } = store.get() setTimeout(() => { - if (copyPasteMode) { - window.open(oauthUrl, '_blank', 'noopener') - } else { - document.location.href = oauthUrl - } + document.location.href = oauthUrl }, 200) } @@ -102,8 +96,7 @@ async function registerNewInstance (code) { loggedInInstances: loggedInInstances, currentInstance: currentRegisteredInstanceName, loggedInInstancesInOrder: loggedInInstancesInOrder, - instanceThemes: instanceThemes, - copyPasteMode: false + instanceThemes: instanceThemes }) store.save() const { enableGrayscale } = store.get() @@ -124,16 +117,3 @@ export async function handleOauthCode (code) { store.set({ logInToInstanceLoading: false }) } } - -export async function handleCopyPasteOauthCode (code) { - const { currentRegisteredInstanceName, currentRegisteredInstance } = store.get() - if (!currentRegisteredInstanceName || !currentRegisteredInstance) { - store.set({ - logInToInstanceError: 'You must log in to an instance first.', - logInToInstanceErrorForText: '', - instanceNameInSearch: '' - }) - } else { - await handleOauthCode(code) - } -} diff --git a/src/routes/_pages/settings/instances/add.html b/src/routes/_pages/settings/instances/add.html index 0f2fa9ae..9e20a8c0 100644 --- a/src/routes/_pages/settings/instances/add.html +++ b/src/routes/_pages/settings/instances/add.html @@ -33,19 +33,6 @@ Log in - - {#if $copyPasteMode } -
- - - -
- {/if} {#if !$isUserLoggedIn} @@ -59,23 +46,6 @@ Join Mastodon!

{/if} -

- {#if $copyPasteMode} - Switch back to - {:else} - Trouble logging in? Switch to - {/if} - . -

- {#if $copyPasteMode} - - In basic login mode, click "log in" to open a new window. Then copy the code and paste it above. - - {/if}