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

11 lines
292 B
TypeScript
Raw Normal View History

2019-12-01 22:12:13 +01:00
import { GiteaUnauthorizedError } from "../../util/gitea";
import { put } from 'redux-saga/effects';
2019-12-13 15:48:58 +01:00
import { logout } from '../actions/logout';
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) {
2019-12-13 14:21:20 +01:00
yield put(logout());
2019-12-01 22:12:13 +01:00
}
2019-11-28 14:12:48 +01:00
}