Merge branch 'revoke' into 'develop'
Fix /oauth/revoke 404 See merge request soapbox-pub/soapbox!2515
This commit is contained in:
commit
881c8083d2
1 changed files with 5 additions and 2 deletions
|
@ -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<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 }) => {
|
||||
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 => {
|
||||
|
|
Loading…
Reference in a new issue