gengitkan/client/src/store/sagas/failure.js

11 lines
300 B
JavaScript
Raw Normal View History

2019-12-01 22:12:13 +01:00
import { GiteaUnauthorizedError } from "../../util/gitea";
import { LOGOUT } from "../actions/logout";
import { put } from 'redux-saga/effects';
2019-11-28 14:12:48 +01:00
2019-12-01 22:12:13 +01:00
export function* failuresSaga(action) {
const err = action.error;
if (err instanceof GiteaUnauthorizedError) {
yield put({ type: LOGOUT });
}
2019-11-28 14:12:48 +01:00
}