mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-03-04 15:13:17 +05:30
#151: notify an api about user being logged out
This commit is contained in:
parent
d2ca6b23c7
commit
d36e771c4f
@ -2,6 +2,7 @@ import { routeActions } from 'react-router-redux';
|
||||
|
||||
import request from 'services/request';
|
||||
import accounts from 'services/api/accounts';
|
||||
import authentication from 'services/api/authentication';
|
||||
import { setLocale } from 'components/i18n/actions';
|
||||
|
||||
export const UPDATE = 'USER_UPDATE';
|
||||
@ -45,6 +46,7 @@ export function setUser(payload) {
|
||||
|
||||
export function logout() {
|
||||
return (dispatch, getState) => {
|
||||
authentication.logout();
|
||||
dispatch(setUser({
|
||||
lang: getState().user.lang,
|
||||
isGuest: true
|
||||
@ -107,7 +109,6 @@ export function authenticate(token, refreshToken) { // TODO: this action, probab
|
||||
};
|
||||
}
|
||||
|
||||
import authentication from 'services/api/authentication';
|
||||
function requestAccessToken(refreshToken, dispatch) {
|
||||
let promise;
|
||||
if (refreshToken) {
|
||||
|
@ -12,6 +12,10 @@ export default {
|
||||
);
|
||||
},
|
||||
|
||||
logout() {
|
||||
return request.post('/api/authentication/logout');
|
||||
},
|
||||
|
||||
refreshToken(refresh_token) {
|
||||
return request.post(
|
||||
'/api/authentication/refresh-token',
|
||||
|
Loading…
x
Reference in New Issue
Block a user