From f4da2006ef58584f1e01dd409316fd65757533f1 Mon Sep 17 00:00:00 2001 From: oakes Date: Thu, 18 May 2023 11:17:55 -0400 Subject: [PATCH] Pass baseURL when revoking oauth token --- app/soapbox/actions/oauth.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/soapbox/actions/oauth.ts b/app/soapbox/actions/oauth.ts index 55df6f1ae..1dc318648 100644 --- a/app/soapbox/actions/oauth.ts +++ b/app/soapbox/actions/oauth.ts @@ -6,6 +6,8 @@ * @see module:soapbox/actions/auth */ +import { getBaseURL } from 'soapbox/utils/state'; + import { baseClient } from '../api'; import type { AppDispatch } from 'soapbox/store'; @@ -31,9 +33,10 @@ export const obtainOAuthToken = (params: Record, bas }; export const revokeOAuthToken = (params: Record) => - (dispatch: AppDispatch) => { + (dispatch: AppDispatch, getState: () => RootState) => { dispatch({ type: OAUTH_TOKEN_REVOKE_REQUEST, params }); - return baseClient().post('/oauth/revoke', params).then(({ data }) => { + const baseURL = getBaseURL(getState()); + return baseClient(null, baseURL).post('/oauth/revoke', params).then(({ data }) => { dispatch({ type: OAUTH_TOKEN_REVOKE_SUCCESS, params, data }); return data; }).catch(error => {