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 => {