From 3fbc912dae764ba69827c968a6671e19fe3cd9a6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 8 Jul 2022 14:38:36 -0500 Subject: [PATCH 1/3] logIn: rethrow 403 for non-waitlisted account --- app/soapbox/actions/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/actions/auth.ts b/app/soapbox/actions/auth.ts index e6ab20e9b2..5a5468e7ff 100644 --- a/app/soapbox/actions/auth.ts +++ b/app/soapbox/actions/auth.ts @@ -181,7 +181,7 @@ export const verifyCredentials = (token: string, accountUrl?: string) => { } else { if (getState().me === null) dispatch(fetchMeFail(error)); dispatch({ type: VERIFY_CREDENTIALS_FAIL, token, error, skipAlert: true }); - return error; + throw error; } }); }; From da9eaf2b8279d8968a73e22c159a8bfcba6c6a0a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 8 Jul 2022 14:48:06 -0500 Subject: [PATCH 2/3] verifyCredentials: do alert on failure --- app/soapbox/actions/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/actions/auth.ts b/app/soapbox/actions/auth.ts index 5a5468e7ff..e219741164 100644 --- a/app/soapbox/actions/auth.ts +++ b/app/soapbox/actions/auth.ts @@ -180,7 +180,7 @@ export const verifyCredentials = (token: string, accountUrl?: string) => { return account; } else { if (getState().me === null) dispatch(fetchMeFail(error)); - dispatch({ type: VERIFY_CREDENTIALS_FAIL, token, error, skipAlert: true }); + dispatch({ type: VERIFY_CREDENTIALS_FAIL, token, error }); throw error; } }); From 1b373fae9794f9a0f6e56803af955dfb5dd57060 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 8 Jul 2022 15:08:24 -0500 Subject: [PATCH 3/3] Fix registration test --- .../features/verification/__tests__/registration.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/verification/__tests__/registration.test.tsx b/app/soapbox/features/verification/__tests__/registration.test.tsx index f82c0dab46..fbde2fce36 100644 --- a/app/soapbox/features/verification/__tests__/registration.test.tsx +++ b/app/soapbox/features/verification/__tests__/registration.test.tsx @@ -18,7 +18,7 @@ describe('', () => { mock.onPost('/api/v1/pepe/accounts').reply(200, {}); mock.onPost('/api/v1/apps').reply(200, {}); mock.onPost('/oauth/token').reply(200, {}); - mock.onPost('/api/v1/accounts/verify_credentials').reply(200, {}); + mock.onGet('/api/v1/accounts/verify_credentials').reply(200, { id: '123' }); mock.onGet('/api/v1/instance').reply(200, {}); }); });