From 8bc8137231759844f373d59dfb1626cd81dfe809 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 8 Jul 2022 13:02:07 -0500 Subject: [PATCH] actions/auth: ignore the backend error message, always display "wrong username/password" --- app/soapbox/actions/auth.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/soapbox/actions/auth.ts b/app/soapbox/actions/auth.ts index 40532a582..e6ab20e9b 100644 --- a/app/soapbox/actions/auth.ts +++ b/app/soapbox/actions/auth.ts @@ -214,14 +214,6 @@ export const logIn = (username: string, password: string) => if ((error.response?.data as any).error === 'mfa_required') { // If MFA is required, throw the error and handle it in the component. throw error; - } else if ((error.response?.data as any).error === 'invalid_grant') { - // Mastodon returns this user-unfriendly error as a catch-all - // for everything from "bad request" to "wrong password". - // Assume our code is correct and it's a wrong password. - dispatch(snackbar.error(messages.invalidCredentials)); - } else if ((error.response?.data as any).error) { - // If the backend returns an error, display it. - dispatch(snackbar.error((error.response?.data as any).error)); } else { // Return "wrong password" message. dispatch(snackbar.error(messages.invalidCredentials));