12 lines
439 B
JavaScript
12 lines
439 B
JavaScript
import { put } from 'redux-saga/effects';
|
|
import { UnauthorizedError } from '../../errors/unauthorized.error.js';
|
|
import { addMessage } from '../../actions/message.actions.js';
|
|
import { logout } from '../../actions/auth.actions.js';
|
|
|
|
export function* failureActionSaga({ error }) {
|
|
if (error instanceof UnauthorizedError) {
|
|
yield put(addMessage('danger', 'Vous avez été déconnecté.'));
|
|
yield put(logout());
|
|
}
|
|
}
|