oauth/revoke: use the baseURL of the current user for the API request

maybe-fix-revoke
Alex Gleason 2023-01-03 11:04:38 -06:00
rodzic a700461cbf
commit d4e4dbe220
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -6,9 +6,9 @@
* @see module:soapbox/actions/auth
*/
import { baseClient } from '../api';
import api, { baseClient } from '../api';
import type { AppDispatch } from 'soapbox/store';
import type { AppDispatch, RootState } from 'soapbox/store';
export const OAUTH_TOKEN_CREATE_REQUEST = 'OAUTH_TOKEN_CREATE_REQUEST';
export const OAUTH_TOKEN_CREATE_SUCCESS = 'OAUTH_TOKEN_CREATE_SUCCESS';
@ -31,9 +31,9 @@ export const obtainOAuthToken = (params: Record<string, string | undefined>, bas
};
export const revokeOAuthToken = (params: Record<string, string>) =>
(dispatch: AppDispatch) => {
(dispatch: AppDispatch, getState: () => RootState) => {
dispatch({ type: OAUTH_TOKEN_REVOKE_REQUEST, params });
return baseClient().post('/oauth/revoke', params).then(({ data }) => {
return api(getState).post('/oauth/revoke', params).then(({ data }) => {
dispatch({ type: OAUTH_TOKEN_REVOKE_SUCCESS, params, data });
return data;
}).catch(error => {